mirror of
https://github.com/home-assistant/core.git
synced 2025-06-25 01:21:51 +02:00
Bump pysmarlaapi version to 0.9.0 (#146629)
Bump pysmarlaapi version Fix default values of entities
This commit is contained in:
@ -22,12 +22,13 @@ async def async_setup_entry(hass: HomeAssistant, entry: FederwiegeConfigEntry) -
|
||||
|
||||
federwiege = Federwiege(hass.loop, connection)
|
||||
federwiege.register()
|
||||
federwiege.connect()
|
||||
|
||||
entry.runtime_data = federwiege
|
||||
|
||||
await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)
|
||||
|
||||
federwiege.connect()
|
||||
|
||||
return True
|
||||
|
||||
|
||||
|
@ -8,5 +8,5 @@
|
||||
"iot_class": "cloud_push",
|
||||
"loggers": ["pysmarlaapi", "pysignalr"],
|
||||
"quality_scale": "bronze",
|
||||
"requirements": ["pysmarlaapi==0.8.2"]
|
||||
"requirements": ["pysmarlaapi==0.9.0"]
|
||||
}
|
||||
|
@ -53,9 +53,10 @@ class SmarlaNumber(SmarlaBaseEntity, NumberEntity):
|
||||
_property: Property[int]
|
||||
|
||||
@property
|
||||
def native_value(self) -> float:
|
||||
def native_value(self) -> float | None:
|
||||
"""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:
|
||||
"""Update to the smarla device."""
|
||||
|
@ -52,7 +52,7 @@ class SmarlaSwitch(SmarlaBaseEntity, SwitchEntity):
|
||||
_property: Property[bool]
|
||||
|
||||
@property
|
||||
def is_on(self) -> bool:
|
||||
def is_on(self) -> bool | None:
|
||||
"""Return the entity value to represent the entity state."""
|
||||
return self._property.get()
|
||||
|
||||
|
2
requirements_all.txt
generated
2
requirements_all.txt
generated
@ -2338,7 +2338,7 @@ pysma==0.7.5
|
||||
pysmappee==0.2.29
|
||||
|
||||
# homeassistant.components.smarla
|
||||
pysmarlaapi==0.8.2
|
||||
pysmarlaapi==0.9.0
|
||||
|
||||
# homeassistant.components.smartthings
|
||||
pysmartthings==3.2.5
|
||||
|
2
requirements_test_all.txt
generated
2
requirements_test_all.txt
generated
@ -1938,7 +1938,7 @@ pysma==0.7.5
|
||||
pysmappee==0.2.29
|
||||
|
||||
# homeassistant.components.smarla
|
||||
pysmarlaapi==0.8.2
|
||||
pysmarlaapi==0.9.0
|
||||
|
||||
# homeassistant.components.smartthings
|
||||
pysmartthings==3.2.5
|
||||
|
@ -53,6 +53,6 @@
|
||||
'last_changed': <ANY>,
|
||||
'last_reported': <ANY>,
|
||||
'last_updated': <ANY>,
|
||||
'state': '1',
|
||||
'state': '1.0',
|
||||
})
|
||||
# ---
|
||||
|
@ -93,11 +93,11 @@ async def test_number_state_update(
|
||||
|
||||
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
|
||||
|
||||
await update_property_listeners(mock_number_property)
|
||||
await hass.async_block_till_done()
|
||||
|
||||
assert hass.states.get(entity_id).state == "100"
|
||||
assert hass.states.get(entity_id).state == "100.0"
|
||||
|
Reference in New Issue
Block a user