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
4 changes: 2 additions & 2 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ jobs:
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0

- name: Initialize CodeQL
uses: github/codeql-action/init@0499de31b99561a6d14a36a5f662c2a54f91beee # v4.31.2
uses: github/codeql-action/init@014f16e7ab1402f30e7c3329d33797e7948572db # v4.31.3
with:
languages: python

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@0499de31b99561a6d14a36a5f662c2a54f91beee # v4.31.2
uses: github/codeql-action/analyze@014f16e7ab1402f30e7c3329d33797e7948572db # v4.31.3
with:
category: "/language:python"
7 changes: 4 additions & 3 deletions homeassistant/components/miele/button.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import logging
from typing import Final

import aiohttp
from aiohttp import ClientResponseError

from homeassistant.components.button import ButtonEntity, ButtonEntityDescription
from homeassistant.core import HomeAssistant
Expand Down Expand Up @@ -153,11 +153,12 @@ async def async_press(self) -> None:
self._device_id,
{PROCESS_ACTION: self.entity_description.press_data},
)
except aiohttp.ClientResponseError as ex:
except ClientResponseError as err:
_LOGGER.debug("Error setting button state for %s: %s", self.entity_id, err)
raise HomeAssistantError(
translation_domain=DOMAIN,
translation_key="set_state_error",
translation_placeholders={
"entity": self.entity_id,
},
) from ex
) from err
5 changes: 3 additions & 2 deletions homeassistant/components/miele/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import logging
from typing import Any, Final, cast

import aiohttp
from aiohttp import ClientResponseError
from pymiele import MieleDevice, MieleTemperature

from homeassistant.components.climate import (
Expand Down Expand Up @@ -250,7 +250,8 @@ async def async_set_temperature(self, **kwargs: Any) -> None:
cast(float, kwargs.get(ATTR_TEMPERATURE)),
self.entity_description.zone,
)
except aiohttp.ClientError as err:
except ClientResponseError as err:
_LOGGER.debug("Error setting climate state for %s: %s", self.entity_id, err)
raise HomeAssistantError(
translation_domain=DOMAIN,
translation_key="set_state_error",
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/miele/coordinator.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ async def _async_update_data(self) -> MieleCoordinatorData:
_LOGGER.debug(
"Error fetching actions for device %s: Status: %s, Message: %s",
device_id,
err.status,
str(err.status),
err.message,
)
actions_json = {}
Expand Down
7 changes: 5 additions & 2 deletions homeassistant/components/miele/fan.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,14 +142,15 @@ async def async_set_percentage(self, percentage: int) -> None:
await self.api.send_action(
self._device_id, {VENTILATION_STEP: ventilation_step}
)
except ClientResponseError as ex:
except ClientResponseError as err:
_LOGGER.debug("Error setting fan state for %s: %s", self.entity_id, err)
raise HomeAssistantError(
translation_domain=DOMAIN,
translation_key="set_state_error",
translation_placeholders={
"entity": self.entity_id,
},
) from ex
) from err
self.device.state_ventilation_step = ventilation_step
self.async_write_ha_state()

Expand All @@ -171,6 +172,7 @@ async def async_turn_on(
translation_key="set_state_error",
translation_placeholders={
"entity": self.entity_id,
"err_status": str(ex.status),
},
) from ex

Expand All @@ -188,6 +190,7 @@ async def async_turn_off(self, **kwargs: Any) -> None:
translation_key="set_state_error",
translation_placeholders={
"entity": self.entity_id,
"err_status": str(ex.status),
},
) from ex

Expand Down
5 changes: 3 additions & 2 deletions homeassistant/components/miele/light.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import logging
from typing import Any, Final

import aiohttp
from aiohttp import ClientResponseError

from homeassistant.components.light import (
ColorMode,
Expand Down Expand Up @@ -131,7 +131,8 @@ async def async_turn_light(self, mode: int) -> None:
await self.api.send_action(
self._device_id, {self.entity_description.light_type: mode}
)
except aiohttp.ClientError as err:
except ClientResponseError as err:
_LOGGER.debug("Error setting light state for %s: %s", self.entity_id, err)
raise HomeAssistantError(
translation_domain=DOMAIN,
translation_key="set_state_error",
Expand Down
8 changes: 4 additions & 4 deletions homeassistant/components/miele/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import logging
from typing import cast

import aiohttp
from aiohttp import ClientResponseError
import voluptuous as vol

from homeassistant.const import ATTR_DEVICE_ID, ATTR_TEMPERATURE
Expand Down Expand Up @@ -107,7 +107,7 @@ async def set_program(call: ServiceCall) -> None:
data = {"programId": call.data[ATTR_PROGRAM_ID]}
try:
await api.set_program(serial_number, data)
except aiohttp.ClientResponseError as ex:
except ClientResponseError as ex:
raise HomeAssistantError(
translation_domain=DOMAIN,
translation_key="set_program_error",
Expand Down Expand Up @@ -137,7 +137,7 @@ async def set_program_oven(call: ServiceCall) -> None:
data["temperature"] = call.data[ATTR_TEMPERATURE]
try:
await api.set_program(serial_number, data)
except aiohttp.ClientResponseError as ex:
except ClientResponseError as ex:
raise HomeAssistantError(
translation_domain=DOMAIN,
translation_key="set_program_oven_error",
Expand All @@ -157,7 +157,7 @@ async def get_programs(call: ServiceCall) -> ServiceResponse:

try:
programs = await api.get_programs(serial_number)
except aiohttp.ClientResponseError as ex:
except ClientResponseError as ex:
raise HomeAssistantError(
translation_domain=DOMAIN,
translation_key="get_programs_error",
Expand Down
8 changes: 5 additions & 3 deletions homeassistant/components/miele/switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import logging
from typing import Any, Final, cast

import aiohttp
from aiohttp import ClientResponseError
from pymiele import MieleDevice

from homeassistant.components.switch import SwitchEntity, SwitchEntityDescription
Expand Down Expand Up @@ -165,7 +165,8 @@ async def async_turn_switch(self, mode: dict[str, str | int | bool]) -> None:
"""Set switch to mode."""
try:
await self.api.send_action(self._device_id, mode)
except aiohttp.ClientError as err:
except ClientResponseError as err:
_LOGGER.debug("Error setting switch state for %s: %s", self.entity_id, err)
raise HomeAssistantError(
translation_domain=DOMAIN,
translation_key="set_state_error",
Expand Down Expand Up @@ -197,7 +198,8 @@ async def async_turn_switch(self, mode: dict[str, str | int | bool]) -> None:
"""Set switch to mode."""
try:
await self.api.send_action(self._device_id, mode)
except aiohttp.ClientError as err:
except ClientResponseError as err:
_LOGGER.debug("Error setting switch state for %s: %s", self.entity_id, err)
raise HomeAssistantError(
translation_domain=DOMAIN,
translation_key="set_state_error",
Expand Down
5 changes: 3 additions & 2 deletions homeassistant/components/miele/vacuum.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,14 +189,15 @@ async def send(self, device_id: str, action: dict[str, Any]) -> None:
"""Send action to the device."""
try:
await self.api.send_action(device_id, action)
except ClientResponseError as ex:
except ClientResponseError as err:
_LOGGER.debug("Error setting vacuum state for %s: %s", self.entity_id, err)
raise HomeAssistantError(
translation_domain=DOMAIN,
translation_key="set_state_error",
translation_placeholders={
"entity": self.entity_id,
},
) from ex
) from err

async def async_clean_spot(self, **kwargs: Any) -> None:
"""Clean spot."""
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/open_router/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
"integration_type": "service",
"iot_class": "cloud_polling",
"quality_scale": "bronze",
"requirements": ["openai==2.2.0", "python-open-router==0.3.2"]
"requirements": ["openai==2.2.0", "python-open-router==0.3.3"]
}
32 changes: 26 additions & 6 deletions homeassistant/components/senz/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from typing import Any

from aiosenz import MODE_AUTO, Thermostat
from httpx import RequestError

from homeassistant.components.climate import (
ClimateEntity,
Expand All @@ -14,6 +15,7 @@
)
from homeassistant.const import ATTR_TEMPERATURE, PRECISION_TENTHS, UnitOfTemperature
from homeassistant.core import HomeAssistant, callback
from homeassistant.exceptions import HomeAssistantError
from homeassistant.helpers.device_registry import DeviceInfo
from homeassistant.helpers.entity_platform import AddConfigEntryEntitiesCallback
from homeassistant.helpers.update_coordinator import CoordinatorEntity
Expand Down Expand Up @@ -81,7 +83,7 @@ def target_temperature(self) -> float:
@property
def available(self) -> bool:
"""Return True if the thermostat is available."""
return self._thermostat.online
return super().available and self._thermostat.online

@property
def hvac_mode(self) -> HVACMode:
Expand All @@ -97,14 +99,32 @@ def hvac_action(self) -> HVACAction:

async def async_set_hvac_mode(self, hvac_mode: HVACMode) -> None:
"""Set new target hvac mode."""
if hvac_mode == HVACMode.AUTO:
await self._thermostat.auto()
else:
await self._thermostat.manual()
try:
if hvac_mode == HVACMode.AUTO:
await self._thermostat.auto()
else:
await self._thermostat.manual()
except RequestError as err:
raise HomeAssistantError(
translation_domain=DOMAIN,
translation_key="set_attribute_error",
translation_placeholders={
"attribute": "hvac mode",
},
) from err
await self.coordinator.async_request_refresh()

async def async_set_temperature(self, **kwargs: Any) -> None:
"""Set new target temperature."""
temp: float = kwargs[ATTR_TEMPERATURE]
await self._thermostat.manual(temp)
try:
await self._thermostat.manual(temp)
except RequestError as err:
raise HomeAssistantError(
translation_domain=DOMAIN,
translation_key="set_attribute_error",
translation_placeholders={
"attribute": "target temperature",
},
) from err
await self.coordinator.async_request_refresh()
3 changes: 3 additions & 0 deletions homeassistant/components/senz/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@
},
"oauth2_implementation_unavailable": {
"message": "[%key:common::exceptions::oauth2_implementation_unavailable::message%]"
},
"set_attribute_error": {
"message": "Failed to set {attribute} on the device."
}
}
}
14 changes: 12 additions & 2 deletions homeassistant/components/shelly/icons.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,16 +77,26 @@
"on": "mdi:home-export-outline"
}
},
"cury_boost": {
"left_slot": {
"default": "mdi:scent",
"state": {
"off": "mdi:scent-off",
"on": "mdi:scent"
}
},
"left_slot_boost": {
"default": "mdi:rocket-launch"
},
"cury_slot": {
"right_slot": {
"default": "mdi:scent",
"state": {
"off": "mdi:scent-off",
"on": "mdi:scent"
}
},
"right_slot_boost": {
"default": "mdi:rocket-launch"
},
"valve_switch": {
"default": "mdi:valve",
"state": {
Expand Down
35 changes: 35 additions & 0 deletions homeassistant/components/shelly/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,41 @@
"name": "Water temperature"
}
},
"switch": {
"charging": {
"name": "Charging"
},
"child_lock": {
"name": "Child lock"
},
"frost_protection": {
"name": "[%key:component::shelly::entity::climate::thermostat::state_attributes::preset_mode::state::frost_protection%]"
},
"left_slot": {
"name": "Left slot"
},
"left_slot_boost": {
"name": "Left slot boost"
},
"motion_detection": {
"name": "Motion detection"
},
"right_slot": {
"name": "Right slot"
},
"right_slot_boost": {
"name": "Right slot boost"
},
"thermostat_enabled": {
"name": "Thermostat enabled"
},
"valve_opened": {
"name": "Valve opened"
},
"zone_with_number": {
"name": "Zone {zone_number}"
}
},
"update": {
"beta_firmware": {
"name": "Beta firmware"
Expand Down
Loading
Loading