mirror of
https://github.com/home-assistant/core.git
synced 2026-09-26 01:11:51 -04:00
bosch_shc: rename Smart Plug routing switch to "Range extension" (#182836)
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5
parent
602d564903
commit
3eebe7ec5f
@@ -71,7 +71,7 @@
|
||||
"name": "Child lock"
|
||||
},
|
||||
"routing": {
|
||||
"name": "Routing"
|
||||
"name": "Range extension"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,12 +8,14 @@ from unittest.mock import MagicMock, create_autospec, patch
|
||||
from boschshcpy import (
|
||||
BatteryLevelService,
|
||||
PowerSwitchService,
|
||||
RoutingService,
|
||||
SHCBatteryDevice,
|
||||
SHCLightSwitchBSM,
|
||||
SHCMicromoduleBlinds,
|
||||
SHCMicromoduleRelay,
|
||||
SHCPresenceSimulationSystem,
|
||||
SHCShutterControl,
|
||||
SHCSmartPlug,
|
||||
SHCThermostat,
|
||||
ShutterControlService,
|
||||
ThermostatService,
|
||||
@@ -191,6 +193,27 @@ def micromodule_blinds_device(
|
||||
return device
|
||||
|
||||
|
||||
def smart_plug_device(
|
||||
device_id: str = "hdm:ZigBee:plug1",
|
||||
name: str = "Smart Plug",
|
||||
routing: RoutingService.State = RoutingService.State.DISABLED,
|
||||
) -> SHCSmartPlug:
|
||||
"""Build a minimal device double for the smart_plugs bucket."""
|
||||
device = create_autospec(SHCSmartPlug, instance=True, spec_set=True)
|
||||
device.name = name
|
||||
device.id = device_id
|
||||
device.root_device_id = "test-mac"
|
||||
device.serial = f"serial-{device_id}"
|
||||
device.manufacturer = "Bosch"
|
||||
device.device_model = "PSM"
|
||||
device.device_services = []
|
||||
device.deleted = False
|
||||
device.status = "AVAILABLE"
|
||||
device.switchstate = PowerSwitchService.State.OFF
|
||||
device.routing = routing
|
||||
return device
|
||||
|
||||
|
||||
def thermostat_device(
|
||||
device_id: str = "hdm:ZigBee:thermostat1",
|
||||
name: str = "Thermostat",
|
||||
|
||||
@@ -21,6 +21,7 @@ from .conftest import (
|
||||
micromodule_relay_device,
|
||||
presence_simulation_system_device,
|
||||
setup_integration,
|
||||
smart_plug_device,
|
||||
thermostat_device,
|
||||
)
|
||||
|
||||
@@ -193,3 +194,24 @@ async def test_no_presence_simulation_system(
|
||||
await setup_integration(hass, mock_config_entry)
|
||||
|
||||
assert hass.states.get("switch.presence_simulation") is None
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"device_buckets",
|
||||
[{"smart_plugs": [smart_plug_device()]}],
|
||||
indirect=True,
|
||||
)
|
||||
@pytest.mark.usefixtures("mock_session")
|
||||
async def test_smart_plug_routing_switch_name(
|
||||
hass: HomeAssistant,
|
||||
entity_registry: er.EntityRegistry,
|
||||
mock_config_entry: MockConfigEntry,
|
||||
) -> None:
|
||||
"""The Smart Plug's routing switch is named "Range extension", not "Routing"."""
|
||||
await setup_integration(hass, mock_config_entry)
|
||||
|
||||
entry = entity_registry.async_get("switch.smart_plug_range_extension")
|
||||
assert entry is not None
|
||||
state = hass.states.get("switch.smart_plug_range_extension")
|
||||
assert state is not None
|
||||
assert state.attributes["friendly_name"] == "Smart Plug Range extension"
|
||||
|
||||
Reference in New Issue
Block a user