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
2017-11-11 21:36:03 +01:00
committed by Paulus Schoutsen
parent 68fb995c63
commit db56748d88
6 changed files with 82 additions and 45 deletions

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