mirror of
https://github.com/home-assistant/core.git
synced 2025-07-18 18:57:06 +00:00
Use _attr_force_update in tasmota (#77900)
This commit is contained in:
parent
6864f43986
commit
19b85851a1
@ -58,6 +58,7 @@ class TasmotaBinarySensor(
|
|||||||
):
|
):
|
||||||
"""Representation a Tasmota binary sensor."""
|
"""Representation a Tasmota binary sensor."""
|
||||||
|
|
||||||
|
_attr_force_update = True
|
||||||
_tasmota_entity: tasmota_switch.TasmotaSwitch
|
_tasmota_entity: tasmota_switch.TasmotaSwitch
|
||||||
|
|
||||||
def __init__(self, **kwds: Any) -> None:
|
def __init__(self, **kwds: Any) -> None:
|
||||||
@ -98,11 +99,6 @@ class TasmotaBinarySensor(
|
|||||||
|
|
||||||
self.async_write_ha_state()
|
self.async_write_ha_state()
|
||||||
|
|
||||||
@property
|
|
||||||
def force_update(self) -> bool:
|
|
||||||
"""Force update."""
|
|
||||||
return True
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def is_on(self) -> bool | None:
|
def is_on(self) -> bool | None:
|
||||||
"""Return true if the binary sensor is on."""
|
"""Return true if the binary sensor is on."""
|
||||||
|
@ -229,11 +229,6 @@ class TasmotaLight(
|
|||||||
hs_color = self._hs
|
hs_color = self._hs
|
||||||
return (hs_color[0], hs_color[1])
|
return (hs_color[0], hs_color[1])
|
||||||
|
|
||||||
@property
|
|
||||||
def force_update(self) -> bool:
|
|
||||||
"""Force update."""
|
|
||||||
return False
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def supported_color_modes(self) -> set[str] | None:
|
def supported_color_modes(self) -> set[str] | None:
|
||||||
"""Flag supported color modes."""
|
"""Flag supported color modes."""
|
||||||
|
@ -256,6 +256,7 @@ async def async_setup_entry(
|
|||||||
class TasmotaSensor(TasmotaAvailability, TasmotaDiscoveryUpdate, SensorEntity):
|
class TasmotaSensor(TasmotaAvailability, TasmotaDiscoveryUpdate, SensorEntity):
|
||||||
"""Representation of a Tasmota sensor."""
|
"""Representation of a Tasmota sensor."""
|
||||||
|
|
||||||
|
_attr_force_update = True
|
||||||
_tasmota_entity: tasmota_sensor.TasmotaSensor
|
_tasmota_entity: tasmota_sensor.TasmotaSensor
|
||||||
|
|
||||||
def __init__(self, **kwds: Any) -> None:
|
def __init__(self, **kwds: Any) -> None:
|
||||||
@ -332,11 +333,6 @@ class TasmotaSensor(TasmotaAvailability, TasmotaDiscoveryUpdate, SensorEntity):
|
|||||||
return self._state_timestamp
|
return self._state_timestamp
|
||||||
return self._state
|
return self._state
|
||||||
|
|
||||||
@property
|
|
||||||
def force_update(self) -> bool:
|
|
||||||
"""Force update."""
|
|
||||||
return True
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def native_unit_of_measurement(self) -> str | None:
|
def native_unit_of_measurement(self) -> str | None:
|
||||||
"""Return the unit this state is expressed in."""
|
"""Return the unit this state is expressed in."""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user