Bump pysmarlaapi version to 0.9.0 (#146629)

Bump pysmarlaapi version
Fix default values of entities
This commit is contained in:
Robin Lintermann 2025-06-17 11:23:50 +02:00 committed by GitHub
parent 40a00fb790
commit adc4e9fdc1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 12 additions and 10 deletions

View File

@ -22,12 +22,13 @@ async def async_setup_entry(hass: HomeAssistant, entry: FederwiegeConfigEntry) -
federwiege = Federwiege(hass.loop, connection) federwiege = Federwiege(hass.loop, connection)
federwiege.register() federwiege.register()
federwiege.connect()
entry.runtime_data = federwiege entry.runtime_data = federwiege
await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS) await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)
federwiege.connect()
return True return True

View File

@ -8,5 +8,5 @@
"iot_class": "cloud_push", "iot_class": "cloud_push",
"loggers": ["pysmarlaapi", "pysignalr"], "loggers": ["pysmarlaapi", "pysignalr"],
"quality_scale": "bronze", "quality_scale": "bronze",
"requirements": ["pysmarlaapi==0.8.2"] "requirements": ["pysmarlaapi==0.9.0"]
} }

View File

@ -53,9 +53,10 @@ class SmarlaNumber(SmarlaBaseEntity, NumberEntity):
_property: Property[int] _property: Property[int]
@property @property
def native_value(self) -> float: def native_value(self) -> float | None:
"""Return the entity value to represent the entity state.""" """Return the entity value to represent the entity state."""
return self._property.get() v = self._property.get()
return float(v) if v is not None else None
def set_native_value(self, value: float) -> None: def set_native_value(self, value: float) -> None:
"""Update to the smarla device.""" """Update to the smarla device."""

View File

@ -52,7 +52,7 @@ class SmarlaSwitch(SmarlaBaseEntity, SwitchEntity):
_property: Property[bool] _property: Property[bool]
@property @property
def is_on(self) -> bool: def is_on(self) -> bool | None:
"""Return the entity value to represent the entity state.""" """Return the entity value to represent the entity state."""
return self._property.get() return self._property.get()

2
requirements_all.txt generated
View File

@ -2338,7 +2338,7 @@ pysma==0.7.5
pysmappee==0.2.29 pysmappee==0.2.29
# homeassistant.components.smarla # homeassistant.components.smarla
pysmarlaapi==0.8.2 pysmarlaapi==0.9.0
# homeassistant.components.smartthings # homeassistant.components.smartthings
pysmartthings==3.2.5 pysmartthings==3.2.5

View File

@ -1938,7 +1938,7 @@ pysma==0.7.5
pysmappee==0.2.29 pysmappee==0.2.29
# homeassistant.components.smarla # homeassistant.components.smarla
pysmarlaapi==0.8.2 pysmarlaapi==0.9.0
# homeassistant.components.smartthings # homeassistant.components.smartthings
pysmartthings==3.2.5 pysmartthings==3.2.5

View File

@ -53,6 +53,6 @@
'last_changed': <ANY>, 'last_changed': <ANY>,
'last_reported': <ANY>, 'last_reported': <ANY>,
'last_updated': <ANY>, 'last_updated': <ANY>,
'state': '1', 'state': '1.0',
}) })
# --- # ---

View File

@ -93,11 +93,11 @@ async def test_number_state_update(
entity_id = entity_info["entity_id"] entity_id = entity_info["entity_id"]
assert hass.states.get(entity_id).state == "1" assert hass.states.get(entity_id).state == "1.0"
mock_number_property.get.return_value = 100 mock_number_property.get.return_value = 100
await update_property_listeners(mock_number_property) await update_property_listeners(mock_number_property)
await hass.async_block_till_done() await hass.async_block_till_done()
assert hass.states.get(entity_id).state == "100" assert hass.states.get(entity_id).state == "100.0"