diff --git a/homeassistant/components/fibaro/__init__.py b/homeassistant/components/fibaro/__init__.py index 3313e51ce75..18b47649a18 100644 --- a/homeassistant/components/fibaro/__init__.py +++ b/homeassistant/components/fibaro/__init__.py @@ -527,6 +527,11 @@ class FibaroDevice(Entity): return attr + def update(self) -> None: + """Update the available state of the entity.""" + if isinstance(self.fibaro_device, DeviceModel) and self.fibaro_device.has_dead: + self._attr_available = not self.fibaro_device.dead + class FibaroConnectFailed(HomeAssistantError): """Error to indicate we cannot connect to fibaro home center.""" diff --git a/homeassistant/components/fibaro/binary_sensor.py b/homeassistant/components/fibaro/binary_sensor.py index 14f0a6a162c..57b3bc99b4f 100644 --- a/homeassistant/components/fibaro/binary_sensor.py +++ b/homeassistant/components/fibaro/binary_sensor.py @@ -82,6 +82,7 @@ class FibaroBinarySensor(FibaroDevice, BinarySensorEntity): def update(self) -> None: """Get the latest data and update the state.""" + super().update() if self._fibaro_sensor_type == "com.fibaro.accelerometer": # Accelerator sensors have values for the three axis x, y and z moving_values = self._get_moving_values() diff --git a/homeassistant/components/fibaro/light.py b/homeassistant/components/fibaro/light.py index 577c6612552..6a918f64f86 100644 --- a/homeassistant/components/fibaro/light.py +++ b/homeassistant/components/fibaro/light.py @@ -176,6 +176,7 @@ class FibaroLight(FibaroDevice, LightEntity): def _update(self): """Really update the state.""" + super().update() # Brightness handling if brightness_supported(self.supported_color_modes): self._attr_brightness = scaleto255(self.fibaro_device.value.int_value()) diff --git a/homeassistant/components/fibaro/lock.py b/homeassistant/components/fibaro/lock.py index 0fa1337e3e3..503407bc28f 100644 --- a/homeassistant/components/fibaro/lock.py +++ b/homeassistant/components/fibaro/lock.py @@ -52,4 +52,5 @@ class FibaroLock(FibaroDevice, LockEntity): def update(self) -> None: """Update device state.""" + super().update() self._attr_is_locked = self.current_binary_state diff --git a/homeassistant/components/fibaro/sensor.py b/homeassistant/components/fibaro/sensor.py index 6bb8291bbbb..c41c4afe312 100644 --- a/homeassistant/components/fibaro/sensor.py +++ b/homeassistant/components/fibaro/sensor.py @@ -146,6 +146,7 @@ class FibaroSensor(FibaroDevice, SensorEntity): def update(self) -> None: """Update the state.""" + super().update() with suppress(TypeError): self._attr_native_value = self.fibaro_device.value.float_value() @@ -170,6 +171,7 @@ class FibaroAdditionalSensor(FibaroDevice, SensorEntity): def update(self) -> None: """Update the state.""" + super().update() with suppress(KeyError, ValueError): self._attr_native_value = convert( self.fibaro_device.properties[self.entity_description.key], diff --git a/homeassistant/components/fibaro/switch.py b/homeassistant/components/fibaro/switch.py index d5c6eebeee5..6ca770ab2d1 100644 --- a/homeassistant/components/fibaro/switch.py +++ b/homeassistant/components/fibaro/switch.py @@ -52,4 +52,5 @@ class FibaroSwitch(FibaroDevice, SwitchEntity): def update(self) -> None: """Update device state.""" + super().update() self._attr_is_on = self.current_binary_state