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 homeassistant/components/esphome/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"mqtt": ["esphome/discover/#"],
"quality_scale": "platinum",
"requirements": [
"aioesphomeapi==41.15.0",
"aioesphomeapi==41.16.0",
"esphome-dashboard-api==1.3.0",
"bleak-esphome==3.4.0"
],
Expand Down
1 change: 1 addition & 0 deletions homeassistant/components/hue/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
"initial_press": "\"{subtype}\" pressed initially",
"repeat": "\"{subtype}\" held down",
"short_release": "\"{subtype}\" released after short press",
"long_press": "\"{subtype}\" long pressed",
"long_release": "[%key:component::hue::device_automation::trigger_type::remote_button_long_release%]",
"double_short_release": "[%key:component::hue::device_automation::trigger_type::remote_double_button_short_press%]",
"start": "[%key:component::hue::device_automation::trigger_type::initial_press%]"
Expand Down
10 changes: 3 additions & 7 deletions homeassistant/components/shelly/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -749,17 +749,13 @@ def hvac_action(self) -> HVACAction:

async def async_set_temperature(self, **kwargs: Any) -> None:
"""Set new target temperature."""
await self.call_rpc(
"Thermostat.SetConfig",
{"config": {"id": self._id, "target_C": kwargs[ATTR_TEMPERATURE]}},
await self.coordinator.device.climate_set_target_temperature(
self._id, kwargs[ATTR_TEMPERATURE]
)

async def async_set_hvac_mode(self, hvac_mode: HVACMode) -> None:
"""Set hvac mode."""
mode = hvac_mode in (HVACMode.COOL, HVACMode.HEAT)
await self.call_rpc(
"Thermostat.SetConfig", {"config": {"id": self._id, "enable": mode}}
)
await self.coordinator.device.climate_set_hvac_mode(self._id, str(hvac_mode))


class RpcBluTrvClimate(ShellyRpcEntity, ClimateEntity):
Expand Down
3 changes: 3 additions & 0 deletions homeassistant/components/shelly/icons.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@
"on": "mdi:valve-open"
}
},
"cury_boost": {
"default": "mdi:rocket-launch"
},
"cury_slot": {
"default": "mdi:scent",
"state": {
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/shelly/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"iot_class": "local_push",
"loggers": ["aioshelly"],
"quality_scale": "silver",
"requirements": ["aioshelly==13.13.0"],
"requirements": ["aioshelly==13.14.0"],
"zeroconf": [
{
"type": "_http._tcp.local.",
Expand Down
26 changes: 26 additions & 0 deletions homeassistant/components/shelly/switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,19 @@ class RpcSwitchDescription(RpcEntityDescription, SwitchEntityDescription):
available=lambda status: (left := status["left"]) is not None
and left.get("vial", {}).get("level", -1) != -1,
),
"cury_left_boost": RpcSwitchDescription(
key="cury",
sub_key="slots",
name="Left slot boost",
translation_key="cury_boost",
is_on=lambda status: status["slots"]["left"]["boost"] is not None,
method_on="cury_boost",
method_off="cury_stop_boost",
method_params_fn=lambda id, _: (id, "left"),
entity_registry_enabled_default=True,
available=lambda status: (left := status["left"]) is not None
and left.get("vial", {}).get("level", -1) != -1,
),
"cury_right": RpcSwitchDescription(
key="cury",
sub_key="slots",
Expand All @@ -256,6 +269,19 @@ class RpcSwitchDescription(RpcEntityDescription, SwitchEntityDescription):
available=lambda status: (right := status["right"]) is not None
and right.get("vial", {}).get("level", -1) != -1,
),
"cury_right_boost": RpcSwitchDescription(
key="cury",
sub_key="slots",
name="Right slot boost",
translation_key="cury_boost",
is_on=lambda status: status["slots"]["right"]["boost"] is not None,
method_on="cury_boost",
method_off="cury_stop_boost",
method_params_fn=lambda id, _: (id, "right"),
entity_registry_enabled_default=True,
available=lambda status: (right := status["right"]) is not None
and right.get("vial", {}).get("level", -1) != -1,
),
}


Expand Down
1 change: 1 addition & 0 deletions homeassistant/components/switchbot_cloud/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ async def make_device_data(
"Robot Vacuum Cleaner K10+ Pro Combo",
"Robot Vacuum Cleaner S10",
"S20",
"Robot Vacuum Cleaner K11 Plus",
]:
coordinator = await coordinator_for_device(
hass, entry, api, device, coordinators_by_id, True
Expand Down
17 changes: 8 additions & 9 deletions homeassistant/components/switchbot_cloud/vacuum.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,8 @@ def _set_attributes(self) -> None:
self._attr_fan_speed = VACUUM_FAN_SPEED_QUIET


class SwitchBotCloudVacuumK20PlusPro(SwitchBotCloudVacuum):
"""Representation of a SwitchBot K20+ Pro."""
class SwitchBotCloudVacuumV2(SwitchBotCloudVacuum):
"""Representation of a SwitchBot K20+ Pro & Robot Vacuum Cleaner K11 Plus."""

async def async_set_fan_speed(self, fan_speed: str, **kwargs: Any) -> None:
"""Set fan speed."""
Expand Down Expand Up @@ -176,7 +176,7 @@ async def async_start(self) -> None:
await self.coordinator.async_request_refresh()


class SwitchBotCloudVacuumK10PlusProCombo(SwitchBotCloudVacuumK20PlusPro):
class SwitchBotCloudVacuumK10PlusProCombo(SwitchBotCloudVacuumV2):
"""Representation of a SwitchBot vacuum K10+ Pro Combo."""

async def async_set_fan_speed(self, fan_speed: str, **kwargs: Any) -> None:
Expand All @@ -194,7 +194,7 @@ async def async_set_fan_speed(self, fan_speed: str, **kwargs: Any) -> None:
await self.coordinator.async_request_refresh()


class SwitchBotCloudVacuumV3(SwitchBotCloudVacuumK20PlusPro):
class SwitchBotCloudVacuumV3(SwitchBotCloudVacuumV2):
"""Representation of a SwitchBot vacuum Robot Vacuum Cleaner S10 & S20."""

async def async_set_fan_speed(self, fan_speed: str, **kwargs: Any) -> None:
Expand Down Expand Up @@ -236,16 +236,15 @@ def _async_make_entity(
api: SwitchBotAPI, device: Device | Remote, coordinator: SwitchBotCoordinator
) -> (
SwitchBotCloudVacuum
| SwitchBotCloudVacuumK20PlusPro
| SwitchBotCloudVacuumV2
| SwitchBotCloudVacuumV3
| SwitchBotCloudVacuumK10PlusProCombo
):
"""Make a SwitchBotCloudVacuum."""
if device.device_type in VacuumCleanerV2Commands.get_supported_devices():
if device.device_type == "K20+ Pro":
return SwitchBotCloudVacuumK20PlusPro(api, device, coordinator)
if device.device_type in ["K20+ Pro", "Robot Vacuum Cleaner K11 Plus"]:
return SwitchBotCloudVacuumV2(api, device, coordinator)
if device.device_type == "Robot Vacuum Cleaner K10+ Pro Combo":
return SwitchBotCloudVacuumK10PlusProCombo(api, device, coordinator)

if device.device_type in VacuumCleanerV3Commands.get_supported_devices():
return SwitchBotCloudVacuumV3(api, device, coordinator)
return SwitchBotCloudVacuum(api, device, coordinator)
2 changes: 1 addition & 1 deletion homeassistant/package_constraints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ multidict>=6.0.2
backoff>=2.0

# ensure pydantic version does not float since it might have breaking changes
pydantic==2.12.0
pydantic==2.12.1

# Required for Python 3.12.4 compatibility (#119223).
mashumaro>=3.13.1
Expand Down
4 changes: 2 additions & 2 deletions 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.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ license-expression==30.4.3
mock-open==1.4.0
mypy-dev==1.19.0a4
pre-commit==4.2.0
pydantic==2.12.0
pydantic==2.12.1
pylint==4.0.0
pylint-per-file-ignores==1.4.0
pipdeptree==2.26.1
Expand Down
4 changes: 2 additions & 2 deletions requirements_test_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 script/gen_requirements_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@
backoff>=2.0

# ensure pydantic version does not float since it might have breaking changes
pydantic==2.12.0
pydantic==2.12.1

# Required for Python 3.12.4 compatibility (#119223).
mashumaro>=3.13.1
Expand Down
96 changes: 96 additions & 0 deletions tests/components/shelly/snapshots/test_switch.ambr
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,54 @@
'state': 'on',
})
# ---
# name: test_cury_switch_entity[switch.test_name_left_slot_boost-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': None,
'config_entry_id': <ANY>,
'config_subentry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'switch',
'entity_category': None,
'entity_id': 'switch.test_name_left_slot_boost',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'options': dict({
}),
'original_device_class': None,
'original_icon': None,
'original_name': 'Left slot boost',
'platform': 'shelly',
'previous_unique_id': None,
'suggested_object_id': None,
'supported_features': 0,
'translation_key': 'cury_boost',
'unique_id': '123456789ABC-cury:0-cury_left_boost',
'unit_of_measurement': None,
})
# ---
# name: test_cury_switch_entity[switch.test_name_left_slot_boost-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'friendly_name': 'Test name Left slot boost',
}),
'context': <ANY>,
'entity_id': 'switch.test_name_left_slot_boost',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'on',
})
# ---
# name: test_cury_switch_entity[switch.test_name_right_slot-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
Expand Down Expand Up @@ -95,3 +143,51 @@
'state': 'off',
})
# ---
# name: test_cury_switch_entity[switch.test_name_right_slot_boost-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': None,
'config_entry_id': <ANY>,
'config_subentry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'switch',
'entity_category': None,
'entity_id': 'switch.test_name_right_slot_boost',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'options': dict({
}),
'original_device_class': None,
'original_icon': None,
'original_name': 'Right slot boost',
'platform': 'shelly',
'previous_unique_id': None,
'suggested_object_id': None,
'supported_features': 0,
'translation_key': 'cury_boost',
'unique_id': '123456789ABC-cury:0-cury_right_boost',
'unit_of_measurement': None,
})
# ---
# name: test_cury_switch_entity[switch.test_name_right_slot_boost-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'friendly_name': 'Test name Right slot boost',
}),
'context': <ANY>,
'entity_id': 'switch.test_name_right_slot_boost',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'off',
})
# ---
8 changes: 2 additions & 6 deletions tests/components/shelly/test_climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -665,9 +665,7 @@ async def test_rpc_climate_hvac_mode(
)
mock_rpc_device.mock_update()

mock_rpc_device.call_rpc.assert_called_once_with(
"Thermostat.SetConfig", {"config": {"id": 0, "enable": False}}
)
mock_rpc_device.climate_set_hvac_mode.assert_called_once_with(0, str(HVACMode.OFF))
assert (state := hass.states.get(entity_id))
assert state.state == HVACMode.OFF

Expand Down Expand Up @@ -717,9 +715,7 @@ async def test_rpc_climate_set_temperature(
)
mock_rpc_device.mock_update()

mock_rpc_device.call_rpc.assert_called_once_with(
"Thermostat.SetConfig", {"config": {"id": 0, "target_C": 28}}
)
mock_rpc_device.climate_set_target_temperature.assert_called_once_with(0, 28)
assert (state := hass.states.get(entity_id))
assert state.attributes[ATTR_TEMPERATURE] == 28

Expand Down
Loading
Loading