Skip to content
Merged
4 changes: 3 additions & 1 deletion homeassistant/components/ecovacs/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ async def async_added_to_hass(self) -> None:
await super().async_added_to_hass()

async def on_info(event: CachedMapInfoEvent) -> None:
self._attr_extra_state_attributes["map_name"] = event.name
for map_obj in event.maps:
if map_obj.using:
self._attr_extra_state_attributes["map_name"] = map_obj.name

async def on_changed(event: MapChangedEvent) -> None:
self._attr_image_last_updated = event.when
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/ecovacs/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
"documentation": "https://www.home-assistant.io/integrations/ecovacs",
"iot_class": "cloud_push",
"loggers": ["sleekxmppfs", "sucks", "deebot_client"],
"requirements": ["py-sucks==0.9.11", "deebot-client==14.0.0"]
"requirements": ["py-sucks==0.9.11", "deebot-client==15.0.0"]
}
14 changes: 12 additions & 2 deletions homeassistant/components/ephember/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@
from __future__ import annotations

from datetime import timedelta
from enum import IntEnum
import logging
from typing import Any

from pyephember2.pyephember2 import (
EphEmber,
ZoneMode,
boiler_state,
zone_current_temperature,
zone_is_active,
zone_is_hotwater,
zone_mode,
zone_name,
Expand Down Expand Up @@ -53,6 +54,15 @@
"OFF": HVACMode.OFF,
}


class EPHBoilerStates(IntEnum):
"""Boiler states for a zone given by the api."""

FIXME = 0
OFF = 1
ON = 2


HA_STATE_TO_EPH = {value: key for key, value in EPH_TO_HA_STATE.items()}


Expand Down Expand Up @@ -123,7 +133,7 @@ def target_temperature(self) -> float | None:
@property
def hvac_action(self) -> HVACAction:
"""Return current HVAC action."""
if zone_is_active(self._zone):
if boiler_state(self._zone) == EPHBoilerStates.ON:
return HVACAction.HEATING

return HVACAction.IDLE
Expand Down
8 changes: 2 additions & 6 deletions homeassistant/components/generic_hygrostat/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ def set_humidifier_entity_id_or_uuid(source_entity_id: str) -> None:
entry,
options={**entry.options, CONF_HUMIDIFIER: source_entity_id},
)
hass.config_entries.async_schedule_reload(entry.entry_id)

entry.async_on_unload(
# We use async_handle_source_entity_changes to track changes to the humidifer,
Expand Down Expand Up @@ -140,6 +141,7 @@ async def async_sensor_updated(
entry,
options={**entry.options, CONF_SENSOR: data["entity_id"]},
)
hass.config_entries.async_schedule_reload(entry.entry_id)

entry.async_on_unload(
async_track_entity_registry_updated_event(
Expand All @@ -148,7 +150,6 @@ async def async_sensor_updated(
)

await hass.config_entries.async_forward_entry_setups(entry, (Platform.HUMIDIFIER,))
entry.async_on_unload(entry.add_update_listener(config_entry_update_listener))
return True


Expand Down Expand Up @@ -186,11 +187,6 @@ async def async_migrate_entry(hass: HomeAssistant, config_entry: ConfigEntry) ->
return True


async def config_entry_update_listener(hass: HomeAssistant, entry: ConfigEntry) -> None:
"""Update listener, called when the config entry options are changed."""
await hass.config_entries.async_reload(entry.entry_id)


async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
"""Unload a config entry."""
return await hass.config_entries.async_unload_platforms(
Expand Down
1 change: 1 addition & 0 deletions homeassistant/components/generic_hygrostat/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ class ConfigFlowHandler(SchemaConfigFlowHandler, domain=DOMAIN):

config_flow = CONFIG_FLOW
options_flow = OPTIONS_FLOW
options_flow_reloads = True

def async_config_entry_title(self, options: Mapping[str, Any]) -> str:
"""Return config entry title."""
Expand Down
6 changes: 0 additions & 6 deletions homeassistant/components/local_file/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,10 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
)

await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)
entry.async_on_unload(entry.add_update_listener(update_listener))

return True


async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
"""Unload Local file config entry."""
return await hass.config_entries.async_unload_platforms(entry, PLATFORMS)


async def update_listener(hass: HomeAssistant, entry: ConfigEntry) -> None:
"""Handle options update."""
await hass.config_entries.async_reload(entry.entry_id)
1 change: 1 addition & 0 deletions homeassistant/components/local_file/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ class LocalFileConfigFlowHandler(SchemaConfigFlowHandler, domain=DOMAIN):

config_flow = CONFIG_FLOW
options_flow = OPTIONS_FLOW
options_flow_reloads = True

def async_config_entry_title(self, options: Mapping[str, Any]) -> str:
"""Return config entry title."""
Expand Down
6 changes: 0 additions & 6 deletions homeassistant/components/systemmonitor/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ async def async_setup_entry(
entry.runtime_data = SystemMonitorData(coordinator, psutil_wrapper)

await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)
entry.async_on_unload(entry.add_update_listener(update_listener))
return True


Expand All @@ -67,11 +66,6 @@ async def async_unload_entry(
return await hass.config_entries.async_unload_platforms(entry, PLATFORMS)


async def update_listener(hass: HomeAssistant, entry: SystemMonitorConfigEntry) -> None:
"""Handle options update."""
await hass.config_entries.async_reload(entry.entry_id)


async def async_migrate_entry(
hass: HomeAssistant, entry: SystemMonitorConfigEntry
) -> bool:
Expand Down
2 changes: 2 additions & 0 deletions homeassistant/components/systemmonitor/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ class SystemMonitorConfigFlowHandler(SchemaConfigFlowHandler, domain=DOMAIN):

config_flow = CONFIG_FLOW
options_flow = OPTIONS_FLOW
options_flow_reloads = True

VERSION = 1
MINOR_VERSION = 3

Expand Down
7 changes: 0 additions & 7 deletions homeassistant/components/tod/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,9 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
entry, (Platform.BINARY_SENSOR,)
)

entry.async_on_unload(entry.add_update_listener(config_entry_update_listener))

return True


async def config_entry_update_listener(hass: HomeAssistant, entry: ConfigEntry) -> None:
"""Update listener, called when the config entry options are changed."""
await hass.config_entries.async_reload(entry.entry_id)


async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
"""Unload a config entry."""
return await hass.config_entries.async_unload_platforms(
Expand Down
1 change: 1 addition & 0 deletions homeassistant/components/tod/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ class ConfigFlowHandler(SchemaConfigFlowHandler, domain=DOMAIN):

config_flow = CONFIG_FLOW
options_flow = OPTIONS_FLOW
options_flow_reloads = True

def async_config_entry_title(self, options: Mapping[str, Any]) -> str:
"""Return config entry title."""
Expand Down
7 changes: 1 addition & 6 deletions homeassistant/components/trend/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ def set_source_entity_id_or_uuid(source_entity_id: str) -> None:
entry,
options={**entry.options, CONF_ENTITY_ID: source_entity_id},
)
hass.config_entries.async_schedule_reload(entry.entry_id)

async def source_entity_removed() -> None:
# The source entity has been removed, we remove the config entry because
Expand All @@ -57,7 +58,6 @@ async def source_entity_removed() -> None:
)

await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)
entry.async_on_unload(entry.add_update_listener(config_entry_update_listener))

return True

Expand Down Expand Up @@ -96,11 +96,6 @@ async def async_migrate_entry(hass: HomeAssistant, config_entry: ConfigEntry) ->
return True


async def config_entry_update_listener(hass: HomeAssistant, entry: ConfigEntry) -> None:
"""Handle an Trend options update."""
await hass.config_entries.async_reload(entry.entry_id)


async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
"""Unload a config entry."""
return await hass.config_entries.async_unload_platforms(entry, PLATFORMS)
1 change: 1 addition & 0 deletions homeassistant/components/trend/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ class ConfigFlowHandler(SchemaConfigFlowHandler, domain=DOMAIN):
options_flow = {
"init": SchemaFlowFormStep(get_extended_options_schema),
}
options_flow_reloads = True

def async_config_entry_title(self, options: Mapping[str, Any]) -> str:
"""Return config entry title."""
Expand Down
10 changes: 5 additions & 5 deletions homeassistant/components/workday/calendar.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from __future__ import annotations

from datetime import datetime, timedelta
from datetime import date, datetime, timedelta

from holidays import HolidayBase

Expand All @@ -15,8 +15,6 @@
from .const import CONF_EXCLUDES, CONF_OFFSET, CONF_WORKDAYS
from .entity import BaseWorkdayEntity

CALENDAR_DAYS_AHEAD = 365


async def async_setup_entry(
hass: HomeAssistant,
Expand Down Expand Up @@ -73,8 +71,10 @@ def __init__(
def update_data(self, now: datetime) -> None:
"""Update data."""
event_list = []
for i in range(CALENDAR_DAYS_AHEAD):
future_date = now.date() + timedelta(days=i)
start_date = date(now.year, 1, 1)
end_number_of_days = date(now.year + 1, 12, 31) - start_date
for i in range(end_number_of_days.days + 1):
future_date = start_date + timedelta(days=i)
if self.date_is_workday(future_date):
event = CalendarEvent(
summary=self._name,
Expand Down
2 changes: 1 addition & 1 deletion requirements_all.txt

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion requirements_test_all.txt

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading