Add NX584 alarm binary_sensor zone_number attribute (#36552)
This commit is contained in:
parent
38bb8ef4d2
commit
5f8dcd45c1
2 changed files with 6 additions and 0 deletions
|
@ -101,6 +101,11 @@ class NX584ZoneSensor(BinarySensorEntity):
|
|||
# True means "faulted" or "open" or "abnormal state"
|
||||
return self._zone["state"]
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
"""Return the state attributes."""
|
||||
return {"zone_number": self._zone["number"]}
|
||||
|
||||
|
||||
class NX584Watcher(threading.Thread):
|
||||
"""Event listener thread to process NX584 events."""
|
||||
|
|
|
@ -135,6 +135,7 @@ class TestNX584ZoneSensor(unittest.TestCase):
|
|||
assert "foo" == sensor.name
|
||||
assert not sensor.should_poll
|
||||
assert sensor.is_on
|
||||
assert sensor.device_state_attributes["zone_number"] == 1
|
||||
|
||||
zone["state"] = False
|
||||
assert not sensor.is_on
|
||||
|
|
Loading…
Add table
Reference in a new issue