fixed create_entity warnings
This commit is contained in:
1 parent
caf9051864
commit
d8756928a5
1 file changed
+2
-2
+2
-2
@@ -114,10 +114,10 @@ class SmartObject(hass.Hass,LoggerInterface):
|
|||||||
if state_class is not None: attributes['state_class'] = state_class
|
if state_class is not None: attributes['state_class'] = state_class
|
||||||
|
|
||||||
if state is not None:
|
if state is not None:
|
||||||
entity.set_state(state=state, attributes=attributes)
|
entity.set_state(state=state, attributes=attributes, check_existence=False)
|
||||||
else:
|
else:
|
||||||
if not entity.exists():
|
if not entity.exists():
|
||||||
entity.set_state(state='unknown')
|
entity.set_state(state='unknown', check_existence=False)
|
||||||
entity.set_state(attributes=attributes)
|
entity.set_state(attributes=attributes)
|
||||||
|
|
||||||
return entity
|
return entity
|
||||||
|
|||||||
Reference in new issue
Block a user