Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/actions/setup-uv-python/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ runs:
steps:
- name: Set up uv
id: uv
uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
uses: astral-sh/setup-uv@11f9893b081a58869d3b5fccaea48c9e9e46f990 # v8.3.2
with:
version: ${{ inputs.uv-version }}
python-version: ${{ inputs.python-version }}
Expand Down
63 changes: 62 additions & 1 deletion homeassistant/components/knx/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,50 @@
},
"dpt": {
"options": {
"1": "Generic 1-bit",
"1_001": "Switch",
"1_002": "Boolean",
"1_003": "Enable",
"1_004": "Ramp",
"1_005": "Alarm",
"1_006": "Binary value",
"1_007": "Step",
"1_008": "Up / Down",
"1_009": "Open / Close",
"1_010": "Start",
"1_011": "State",
"1_012": "Invert",
"1_013": "Dimming send style",
"1_014": "Input source",
"1_015": "Reset",
"1_016": "Acknowledge",
"1_017": "Trigger",
"1_018": "Occupancy",
"1_019": "Window / Door",
"1_021": "Logical function",
"1_022": "Scene A/B",
"1_023": "Shutter / Blinds mode",
"1_024": "Day / Night",
"1_100": "Heat / Cool",
"1_1200": "Consumer / Producer",
"1_1201": "Energy direction",
"2": "Generic 2-bit boolean control",
"2_001": "Switch control",
"2_002": "Boolean control",
"2_003": "Enable control",
"2_004": "Ramp control",
"2_005": "Alarm control",
"2_006": "Binary value control",
"2_007": "Step control",
"2_008": "Direction 1 control",
"2_009": "Direction 2 control",
"2_010": "Start control",
"2_011": "State control",
"2_012": "Invert control",
"3_007": "Dimming control",
"3_008": "Blinds control",
"4_001": "Character (ASCII)",
"4_002": "Character (Latin-1)",
"5": "Generic 1-byte unsigned integer",
"5_001": "Percent (0 … 100)",
"5_003": "Angle",
Expand Down Expand Up @@ -273,6 +317,8 @@
"9_029": "Absolute humidity",
"9_030": "Concentration",
"9_60000": "Enthalpy",
"10_001": "Time of day",
"11_001": "Date",
"12": "Generic 4-byte unsigned integer",
"12_001": "Counter (0 … 4 294 967 295)",
"12_100": "Time period (4-byte)",
Expand Down Expand Up @@ -380,10 +426,25 @@
"16_000": "String (ASCII)",
"16_001": "String (Latin-1)",
"17_001": "Scene number",
"18_001": "Scene control",
"19_001": "Date and time",
"20_102": "HVAC mode",
"20_105": "HVAC controller mode",
"20_60102": "HVAC status",
"29": "Generic 8-byte signed integer",
"29_010": "Active energy (8-byte)",
"29_011": "Apparent energy (8-byte)",
"29_012": "Reactive energy (8-byte)"
"29_012": "Reactive energy (8-byte)",
"232_600": "RGB color",
"235_001": "Tariff active energy",
"242_600": "xyY color",
"243_600": "xyY color transition",
"249_600": "Brightness and color temperature transition",
"250_600": "Brightness and color temperature control",
"251_600": "RGBW color",
"252_600": "Relative RGBW control",
"253_600": "Relative xyY control",
"254_600": "Relative RGB control"
},
"selector": {
"label": "Select a datapoint type",
Expand Down
1 change: 1 addition & 0 deletions homeassistant/components/linode/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"domain": "linode",
"name": "Linode",
"codeowners": [],
"disabled": "Linode relies on setuptools.pkg_resources, which is no longer available in setuptools 82.0.0 and later.",
"documentation": "https://www.home-assistant.io/integrations/linode",
"iot_class": "cloud_polling",
"loggers": ["linode"],
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/mealie/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
"integration_type": "service",
"iot_class": "local_polling",
"quality_scale": "platinum",
"requirements": ["aiomealie==2.1.1"]
"requirements": ["aiomealie==2.1.2"]
}
2 changes: 1 addition & 1 deletion homeassistant/components/monarch_money/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/monarchmoney",
"integration_type": "service",
"iot_class": "cloud_polling",
"requirements": ["monarchmoneycommunity==1.5.2"]
"requirements": ["monarchmoneycommunity==1.6.0"]
}
5 changes: 5 additions & 0 deletions homeassistant/components/mystrom/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,10 @@
"name": "Last restart"
}
}
},
"exceptions": {
"switch_action_failed": {
"message": "Failed to perform the action on the myStrom plug."
}
}
}
17 changes: 11 additions & 6 deletions homeassistant/components/mystrom/switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

from homeassistant.components.switch import SwitchEntity
from homeassistant.core import HomeAssistant
from homeassistant.exceptions import HomeAssistantError
from homeassistant.helpers.device_registry import DeviceInfo, format_mac
from homeassistant.helpers.entity_platform import AddConfigEntryEntitiesCallback

Expand Down Expand Up @@ -52,18 +53,22 @@ async def async_turn_on(self, **kwargs: Any) -> None:
"""Turn the switch on."""
try:
await self.plug.turn_on()
# pylint: disable-next=home-assistant-action-swallowed-exception
except MyStromConnectionError:
_LOGGER.error("No route to myStrom plug")
except MyStromConnectionError as err:
raise HomeAssistantError(
translation_domain=DOMAIN,
translation_key="switch_action_failed",
) from err

@override
async def async_turn_off(self, **kwargs: Any) -> None:
"""Turn the switch off."""
try:
await self.plug.turn_off()
# pylint: disable-next=home-assistant-action-swallowed-exception
except MyStromConnectionError:
_LOGGER.error("No route to myStrom plug")
except MyStromConnectionError as err:
raise HomeAssistantError(
translation_domain=DOMAIN,
translation_key="switch_action_failed",
) from err

async def async_update(self) -> None:
"""Get the latest data from the device and update the data."""
Expand Down
17 changes: 17 additions & 0 deletions homeassistant/components/opower/coordinator.py
Original file line number Diff line number Diff line change
Expand Up @@ -585,6 +585,15 @@ def _update_with_finer_cost_reads(
_LOGGER.error("Error getting daily cost reads: %s", err)
raise
_LOGGER.debug("Got %s daily cost reads", len(daily_cost_reads))
if not daily_cost_reads and start_time is not None:
if account.read_resolution is ReadResolution.DAY:
# Nothing finer to fall back to, and see the hourly reads below.
_LOGGER.debug("No daily cost reads. Skipping update")
return []
# The hourly reads below are still finer than the statistics they
# land on, so only drop the bill reads and carry on with those.
_LOGGER.debug("No daily cost reads. Trying the hourly ones")
cost_reads = []
_update_with_finer_cost_reads(cost_reads, daily_cost_reads)
if account.read_resolution is ReadResolution.DAY:
return cost_reads
Expand All @@ -603,6 +612,14 @@ def _update_with_finer_cost_reads(
_LOGGER.error("Error getting hourly cost reads: %s", err)
raise
_LOGGER.debug("Got %s hourly cost reads", len(hourly_cost_reads))
if not hourly_cost_reads and start_time is not None:
# A day read starts at local midnight, where that day's first hourly
# statistic already is, so keeping the daily reads would replace it
# with a coarser one carrying a different running sum. Only a concern
# once statistics exist: on the initial import there is nothing to
# overwrite and the daily reads are the best available data.
_LOGGER.debug("No hourly cost reads. Skipping update")
return []
_update_with_finer_cost_reads(cost_reads, hourly_cost_reads)
_LOGGER.debug("Got %s cost reads", len(cost_reads))
return cost_reads
2 changes: 1 addition & 1 deletion homeassistant/components/opower/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
"iot_class": "cloud_polling",
"loggers": ["opower"],
"quality_scale": "platinum",
"requirements": ["opower==0.21.0"]
"requirements": ["opower==0.22.1"]
}
35 changes: 3 additions & 32 deletions homeassistant/components/select/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import logging
from typing import Any, final, override

import probatio
from propcache.api import cached_property

from homeassistant.config_entries import ConfigEntry
Expand All @@ -15,22 +14,22 @@
from homeassistant.helpers.entity import Entity, EntityDescription
from homeassistant.helpers.entity_component import EntityComponent
from homeassistant.helpers.typing import ConfigType
from homeassistant.util.hass_dict import HassKey

from .const import (
ATTR_CYCLE,
ATTR_OPTIONS,
DATA_COMPONENT,
DOMAIN,
SERVICE_SELECT_FIRST,
SERVICE_SELECT_LAST,
SERVICE_SELECT_NEXT,
SERVICE_SELECT_PREVIOUS,
SelectEntityCapabilityAttribute,
)
from .services import async_setup_services

_LOGGER = logging.getLogger(__name__)

DATA_COMPONENT: HassKey[EntityComponent[SelectEntity]] = HassKey(DOMAIN)
ENTITY_ID_FORMAT = DOMAIN + ".{}"
PLATFORM_SCHEMA = cv.PLATFORM_SCHEMA
PLATFORM_SCHEMA_BASE = cv.PLATFORM_SCHEMA_BASE
Expand Down Expand Up @@ -65,35 +64,7 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
)
await component.async_setup(config)

component.async_register_entity_service(
SERVICE_SELECT_FIRST,
None,
SelectEntity.async_first.__name__,
)

component.async_register_entity_service(
SERVICE_SELECT_LAST,
None,
SelectEntity.async_last.__name__,
)

component.async_register_entity_service(
SERVICE_SELECT_NEXT,
{probatio.Optional(ATTR_CYCLE, default=True): bool},
SelectEntity.async_next.__name__,
)

component.async_register_entity_service(
SERVICE_SELECT_OPTION,
{probatio.Required(ATTR_OPTION): cv.string},
SelectEntity.async_handle_select_option.__name__,
)

component.async_register_entity_service(
SERVICE_SELECT_PREVIOUS,
{probatio.Optional(ATTR_CYCLE, default=True): bool},
SelectEntity.async_previous.__name__,
)
async_setup_services(hass)

return True

Expand Down
10 changes: 9 additions & 1 deletion homeassistant/components/select/const.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
"""Provides the constants needed for the component."""

from enum import StrEnum
from typing import Final
from typing import TYPE_CHECKING, Final

from homeassistant.util.hass_dict import HassKey

if TYPE_CHECKING:
from homeassistant.helpers.entity_component import EntityComponent

from . import SelectEntity

DOMAIN: Final = "select"
DATA_COMPONENT: HassKey[EntityComponent[SelectEntity]] = HassKey(DOMAIN)


class SelectEntityCapabilityAttribute(StrEnum):
Expand Down
52 changes: 52 additions & 0 deletions homeassistant/components/select/services.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
"""Services for the Select integration."""

import probatio

from homeassistant.const import ATTR_OPTION, SERVICE_SELECT_OPTION
from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers import config_validation as cv

from .const import (
ATTR_CYCLE,
DATA_COMPONENT,
SERVICE_SELECT_FIRST,
SERVICE_SELECT_LAST,
SERVICE_SELECT_NEXT,
SERVICE_SELECT_PREVIOUS,
)


@callback
def async_setup_services(hass: HomeAssistant) -> None:
"""Register the select services."""
component = hass.data[DATA_COMPONENT]

component.async_register_entity_service(
SERVICE_SELECT_FIRST,
None,
"async_first",
)

component.async_register_entity_service(
SERVICE_SELECT_LAST,
None,
"async_last",
)

component.async_register_entity_service(
SERVICE_SELECT_NEXT,
{probatio.Optional(ATTR_CYCLE, default=True): bool},
"async_next",
)

component.async_register_entity_service(
SERVICE_SELECT_OPTION,
{probatio.Required(ATTR_OPTION): cv.string},
"async_handle_select_option",
)

component.async_register_entity_service(
SERVICE_SELECT_PREVIOUS,
{probatio.Optional(ATTR_CYCLE, default=True): bool},
"async_previous",
)
2 changes: 1 addition & 1 deletion homeassistant/components/subaru/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
"iot_class": "cloud_polling",
"loggers": ["stdiomask", "subarulink"],
"quality_scale": "bronze",
"requirements": ["subarulink==0.7.19"]
"requirements": ["subarulink==0.7.21"]
}
1 change: 1 addition & 0 deletions homeassistant/components/tank_utility/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"domain": "tank_utility",
"name": "Tank Utility",
"codeowners": [],
"disabled": "Tank Utility relies on setuptools.pkg_resources, which is no longer available in setuptools 82.0.0 and later.",
"documentation": "https://www.home-assistant.io/integrations/tank_utility",
"iot_class": "cloud_polling",
"loggers": ["tank_utility"],
Expand Down
Loading
Loading