Add attribute to show who last un/set alarm (SPC) (#9906)

* Add attribute to show who last un/set alarm.

This allows showing the name of the SPC user who last
issued an arm/disarm command and also allows for
automations to depend on this value.

* Optimize

* Update spc.py

* Update spc.py

* fix

* Fix test.

* Fix for removed is_state_attr.
This commit is contained in:
Martin Berg authored and Paulus Schoutsen committed 2017-11-11 12:36:03 -08:00
1 parent 68fb995c63
commit db56748d88
6 files changed
+82 -45

No files matched your search

+3 -3
View File
@@ -30,7 +30,7 @@ def test_setup_platform(hass):
'area_name': 'House',
'input': '0',
'status': '0',
}, {
}, {
'id': '3',
'type': '0',
'zone_name': 'Hallway PIR',
@@ -38,7 +38,7 @@ def test_setup_platform(hass):
'area_name': 'House',
'input': '0',
'status': '0',
}, {
}, {
'id': '5',
'type': '1',
'zone_name': 'Front door',
@@ -46,7 +46,7 @@ def test_setup_platform(hass):
'area_name': 'House',
'input': '1',
'status': '0',
}]}
}]}
def add_entities(entities):
nonlocal added_entities