mirror of
https://github.com/joBr99/nspanel-lovelace-ui.git
synced 2026-03-01 16:06:51 +01:00
implement cooldown config option for cards
This commit is contained in:
@@ -648,6 +648,13 @@ class LuiPagesGen(object):
|
||||
|
||||
def render_card(self, card, send_page_type=True):
|
||||
|
||||
# page type is false, so this request is from a callback
|
||||
if not send_page_type and card.cooldown != 0:
|
||||
if (time.time()-card.last_update) < card.cooldown:
|
||||
return
|
||||
card.last_update = time.time()
|
||||
|
||||
|
||||
leftBtn = "delete~~~~~"
|
||||
if card.uuid_prev is not None:
|
||||
leftBtn = self.generate_entities_item(Entity(
|
||||
|
||||
Reference in New Issue
Block a user