Additional SenseME cleanups (#63748)
* Additional SenseME cleanups * drop the super as its no longer needed * one morepull/60829/head^2
parent
8915b73f72
commit
0efdc7fa65
|
@ -41,10 +41,9 @@ class SensemeFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
|
|||
return self.async_abort(reason="already_configured")
|
||||
if entry.unique_id != uuid:
|
||||
continue
|
||||
if entry.data[CONF_INFO]["address"] != host:
|
||||
self.hass.config_entries.async_update_entry(
|
||||
entry, data={CONF_INFO: {**entry.data[CONF_INFO], "address": host}}
|
||||
)
|
||||
self.hass.config_entries.async_update_entry(
|
||||
entry, data={CONF_INFO: {**entry.data[CONF_INFO], "address": host}}
|
||||
)
|
||||
return self.async_abort(reason="already_configured")
|
||||
self._discovered_device = device
|
||||
return await self.async_step_discovery_confirm()
|
||||
|
|
|
@ -27,14 +27,6 @@ class SensemeEntity(Entity):
|
|||
)
|
||||
self._async_update_attrs()
|
||||
|
||||
@property
|
||||
def extra_state_attributes(self) -> dict:
|
||||
"""Get the current device state attributes."""
|
||||
return {
|
||||
"room_name": self._device.room_name,
|
||||
"room_type": self._device.room_type,
|
||||
}
|
||||
|
||||
@callback
|
||||
def _async_update_attrs(self) -> None:
|
||||
"""Update attrs from device."""
|
||||
|
|
|
@ -82,7 +82,6 @@ class HASensemeFan(SensemeEntity, FanEntity):
|
|||
return {
|
||||
"auto_comfort": self._device.fan_autocomfort.capitalize(),
|
||||
"smartmode": self._device.fan_smartmode.capitalize(),
|
||||
**super().extra_state_attributes,
|
||||
}
|
||||
|
||||
async def async_set_percentage(self, percentage: int) -> None:
|
||||
|
|
|
@ -88,6 +88,7 @@ async def test_form_user_manual_entry(hass: HomeAssistant) -> None:
|
|||
)
|
||||
await hass.async_block_till_done()
|
||||
|
||||
assert result3["type"] == RESULT_TYPE_CREATE_ENTRY
|
||||
assert result3["title"] == "Haiku Fan"
|
||||
assert result3["data"] == {
|
||||
"info": MOCK_DEVICE.get_device_info,
|
||||
|
@ -131,6 +132,7 @@ async def test_form_user_no_discovery(hass: HomeAssistant) -> None:
|
|||
)
|
||||
await hass.async_block_till_done()
|
||||
|
||||
assert result3["type"] == RESULT_TYPE_CREATE_ENTRY
|
||||
assert result3["title"] == "Haiku Fan"
|
||||
assert result3["data"] == {
|
||||
"info": MOCK_DEVICE.get_device_info,
|
||||
|
|
Loading…
Reference in New Issue