Compare commits

..
2 Commits
Author SHA1 Message Date
Pierre c71094641b added presence simulation interface 2026-06-21 12:26:02 +02:00
Pierre dbccd2adf6 fix: handle empty string as false in EvaluateBase class 2026-06-17 19:21:04 +02:00
2 changed files with 17 additions and 0 deletions
+1
View File
@@ -71,6 +71,7 @@ class EvaluateBase(object):
if value == 'false': return False if value == 'false': return False
if value == False: return False if value == False: return False
if value == None: return False if value == None: return False
if value == '': return False
# this should be handle explicitely by the condition # this should be handle explicitely by the condition
# edit: this is actually usefull if don't want disable to be evaluated as true # edit: this is actually usefull if don't want disable to be evaluated as true
if value == 'unavailable': return False if value == 'unavailable': return False
+16
View File
@@ -135,6 +135,22 @@ class SmartObject(hass.Hass,LoggerInterface):
# Called at the end of initialize() after all YAML args are processed. # Called at the end of initialize() after all YAML args are processed.
def on_initialize_smart_object(self): pass def on_initialize_smart_object(self): pass
# Presence simulation extension point.
# HomeAlarm can call this method by app name.
def start_presence_simulation(self, source_app=None, slot_name=None, payload=None):
self.log_error(
f"{self.name} does not implement start_presence_simulation "
f"(source_app={source_app}, slot_name={slot_name})"
)
# Presence simulation extension point.
# HomeAlarm can call this method by app name.
def stop_presence_simulation(self, source_app=None, slot_name=None, payload=None):
self.log_error(
f"{self.name} does not implement stop_presence_simulation "
f"(source_app={source_app}, slot_name={slot_name})"
)
# ------------------------------------------------------------------ # ------------------------------------------------------------------
# Dataset persistence helpers # Dataset persistence helpers
# ------------------------------------------------------------------ # ------------------------------------------------------------------