Bump python matter server to 1.0.8 (#84692)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
This commit is contained in:
parent
5bdaad9c13
commit
0e9c6b2bba
10 changed files with 44 additions and 26 deletions
|
@ -39,9 +39,8 @@ class MatterBinarySensor(MatterEntity, BinarySensorEntity):
|
|||
@callback
|
||||
def _update_from_device(self) -> None:
|
||||
"""Update from device."""
|
||||
self._attr_is_on = self._device_type_instance.get_cluster(
|
||||
clusters.BooleanState
|
||||
).stateValue
|
||||
cluster = self._device_type_instance.get_cluster(clusters.BooleanState)
|
||||
self._attr_is_on = cluster.stateValue if cluster else None
|
||||
|
||||
|
||||
class MatterOccupancySensor(MatterBinarySensor):
|
||||
|
@ -52,11 +51,9 @@ class MatterOccupancySensor(MatterBinarySensor):
|
|||
@callback
|
||||
def _update_from_device(self) -> None:
|
||||
"""Update from device."""
|
||||
occupancy = self._device_type_instance.get_cluster(
|
||||
clusters.OccupancySensing
|
||||
).occupancy
|
||||
cluster = self._device_type_instance.get_cluster(clusters.OccupancySensing)
|
||||
# The first bit = if occupied
|
||||
self._attr_is_on = occupancy & 1 == 1
|
||||
self._attr_is_on = cluster.occupancy & 1 == 1 if cluster else None
|
||||
|
||||
|
||||
@dataclass
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue