Skip to content

Commit 650ad72

Browse files
authored
Merge pull request #2081 from rosenrot00/patch-18
Mark Modbus sensor and number entities as push-updated
2 parents f290fcb + 4770711 commit 650ad72

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

custom_components/solax_modbus/number.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,11 @@ async def async_set_value(self, native_value: float) -> None:
158158
def modbus_data_updated(self) -> None:
159159
self.async_write_ha_state()
160160

161+
@property
162+
def should_poll(self) -> bool:
163+
"""Data is delivered by the hub."""
164+
return False
165+
161166
@property
162167
def name(self) -> str:
163168
"""Return the name."""

custom_components/solax_modbus/sensor.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -598,6 +598,11 @@ def native_value(self) -> Any:
598598
# return val
599599
return None
600600

601+
@property
602+
def should_poll(self) -> bool:
603+
"""Data is delivered by the hub."""
604+
return False
605+
601606
@property
602607
def extra_state_attributes(self) -> dict[str, Any]:
603608
attrs = dict(self._attr_extra_state_attributes)

0 commit comments

Comments
 (0)