mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 19:27:45 +00:00
Add NX584 alarm binary_sensor zone_number attribute (#36552)
This commit is contained in:
parent
38bb8ef4d2
commit
5f8dcd45c1
@ -101,6 +101,11 @@ class NX584ZoneSensor(BinarySensorEntity):
|
|||||||
# True means "faulted" or "open" or "abnormal state"
|
# True means "faulted" or "open" or "abnormal state"
|
||||||
return self._zone["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):
|
class NX584Watcher(threading.Thread):
|
||||||
"""Event listener thread to process NX584 events."""
|
"""Event listener thread to process NX584 events."""
|
||||||
|
@ -135,6 +135,7 @@ class TestNX584ZoneSensor(unittest.TestCase):
|
|||||||
assert "foo" == sensor.name
|
assert "foo" == sensor.name
|
||||||
assert not sensor.should_poll
|
assert not sensor.should_poll
|
||||||
assert sensor.is_on
|
assert sensor.is_on
|
||||||
|
assert sensor.device_state_attributes["zone_number"] == 1
|
||||||
|
|
||||||
zone["state"] = False
|
zone["state"] = False
|
||||||
assert not sensor.is_on
|
assert not sensor.is_on
|
||||||
|
Loading…
x
Reference in New Issue
Block a user