Fix elkm1 changed by (#41378)
This commit is contained in:
parent
66e6ae8dbd
commit
95e4048f4e
4 changed files with 11 additions and 13 deletions
|
@ -155,18 +155,16 @@ class ElkArea(ElkAttachedEntity, AlarmControlPanelEntity, RestoreEntity):
|
||||||
self.async_write_ha_state()
|
self.async_write_ha_state()
|
||||||
|
|
||||||
def _watch_area(self, area, changeset):
|
def _watch_area(self, area, changeset):
|
||||||
if not changeset.get("log_event"):
|
last_log = changeset.get("last_log")
|
||||||
|
if not last_log:
|
||||||
|
return
|
||||||
|
# user_number only set for arm/disarm logs
|
||||||
|
if not last_log.get("user_number"):
|
||||||
return
|
return
|
||||||
self._changed_by_keypad = None
|
self._changed_by_keypad = None
|
||||||
self._changed_by_id = area.log_number
|
self._changed_by_id = last_log["user_number"]
|
||||||
self._changed_by = username(self._elk, area.log_number - 1)
|
self._changed_by = username(self._elk, self._changed_by_id - 1)
|
||||||
self._changed_by_time = "%04d-%02d-%02dT%02d:%02d" % (
|
self._changed_by_time = last_log["timestamp"]
|
||||||
area.log_year,
|
|
||||||
area.log_month,
|
|
||||||
area.log_day,
|
|
||||||
area.log_hour,
|
|
||||||
area.log_minute,
|
|
||||||
)
|
|
||||||
self.async_write_ha_state()
|
self.async_write_ha_state()
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
"domain": "elkm1",
|
"domain": "elkm1",
|
||||||
"name": "Elk-M1 Control",
|
"name": "Elk-M1 Control",
|
||||||
"documentation": "https://www.home-assistant.io/integrations/elkm1",
|
"documentation": "https://www.home-assistant.io/integrations/elkm1",
|
||||||
"requirements": ["elkm1-lib==0.7.19"],
|
"requirements": ["elkm1-lib==0.8.0"],
|
||||||
"codeowners": ["@gwww", "@bdraco"],
|
"codeowners": ["@gwww", "@bdraco"],
|
||||||
"config_flow": true
|
"config_flow": true
|
||||||
}
|
}
|
||||||
|
|
|
@ -538,7 +538,7 @@ elgato==0.2.0
|
||||||
eliqonline==1.2.2
|
eliqonline==1.2.2
|
||||||
|
|
||||||
# homeassistant.components.elkm1
|
# homeassistant.components.elkm1
|
||||||
elkm1-lib==0.7.19
|
elkm1-lib==0.8.0
|
||||||
|
|
||||||
# homeassistant.components.mobile_app
|
# homeassistant.components.mobile_app
|
||||||
emoji==0.5.4
|
emoji==0.5.4
|
||||||
|
|
|
@ -278,7 +278,7 @@ eebrightbox==0.0.4
|
||||||
elgato==0.2.0
|
elgato==0.2.0
|
||||||
|
|
||||||
# homeassistant.components.elkm1
|
# homeassistant.components.elkm1
|
||||||
elkm1-lib==0.7.19
|
elkm1-lib==0.8.0
|
||||||
|
|
||||||
# homeassistant.components.mobile_app
|
# homeassistant.components.mobile_app
|
||||||
emoji==0.5.4
|
emoji==0.5.4
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue