Prefix area to entity ID (#170560)

This commit is contained in:
Artur Pragacz
2026-05-19 20:53:26 +02:00
committed by GitHub
parent da4263b95c
commit f823ef639a
282 changed files with 10711 additions and 9771 deletions
+3 -1
View File
@@ -13,7 +13,7 @@ from homeassistant.util.dt import utc_from_timestamp, utcnow
from homeassistant.util.event_type import EventType
from homeassistant.util.hass_dict import HassKey
from . import device_registry as dr, entity_registry as er
from . import device_registry as dr
from .json import json_bytes, json_fragment
from .normalized_name_base_registry import (
NormalizedNameBaseRegistryEntry,
@@ -323,6 +323,8 @@ class AreaRegistry(BaseRegistry[AreasRegistryStoreData]):
@callback
def async_delete(self, area_id: str) -> None:
"""Delete area."""
from . import entity_registry as er # noqa: PLC0415 # Circular dependency
self.hass.verify_event_loop_thread("area_registry.async_delete")
device_registry = dr.async_get(self.hass)
entity_registry = er.async_get(self.hass)
+31 -12
View File
@@ -51,7 +51,7 @@ from homeassistant.util.hass_dict import HassKey
from homeassistant.util.json import format_unserializable_data
from homeassistant.util.read_only_dict import ReadOnlyDict
from . import device_registry as dr, storage
from . import area_registry as ar, device_registry as dr, storage
from .device_registry import (
EVENT_DEVICE_REGISTRY_UPDATED,
EventDeviceRegistryUpdatedData,
@@ -481,6 +481,7 @@ def async_get_unprefixed_name(hass: HomeAssistant, entry: RegistryEntry) -> str:
def _async_get_full_entity_name(
hass: HomeAssistant,
*,
area_id: str | None | UndefinedType = UNDEFINED,
device_id: str | None,
fallback: str,
has_entity_name: bool,
@@ -493,11 +494,11 @@ def _async_get_full_entity_name(
) -> str:
"""Get full name for an entity.
This includes the device name if appropriate.
This includes the device and area name if appropriate.
Used for both full entity name and entity ID.
"""
if name is None and overridden_name is not None:
name = overridden_name
full_name = overridden_name
elif not use_legacy_naming or name is None:
device_name: str | None = None
@@ -507,7 +508,19 @@ def _async_get_full_entity_name(
):
device_name = device.name_by_user or device.name
if name is None:
if area_id is None:
area_id = device.area_id
area_name: str | None = None
if (
area_id is not UNDEFINED
and area_id is not None
and (area := ar.async_get(hass).async_get_area(area_id)) is not None
):
area_name = area.name
entity_name = name
if entity_name is None:
if original_name_unprefixed is UNDEFINED:
original_name_unprefixed = (
_async_strip_prefix_from_entity_name(original_name, device_name)
@@ -515,7 +528,7 @@ def _async_get_full_entity_name(
else None
)
name = (
entity_name = (
original_name_unprefixed
if original_name_unprefixed is not None
else original_name
@@ -523,17 +536,19 @@ def _async_get_full_entity_name(
elif unprefix_name:
unprefixed_name = _async_strip_prefix_from_entity_name(name, device_name)
if unprefixed_name is not None:
name = unprefixed_name
entity_name = unprefixed_name
if not name:
name = device_name
elif device_name:
name = f"{device_name} {name}"
full_name = " ".join(
part for part in (area_name, device_name, entity_name) if part
)
if not name:
else:
full_name = name
if not full_name:
return fallback
return name
return full_name
@callback
@@ -1230,6 +1245,7 @@ class EntityRegistry(BaseRegistry):
def _async_generate_entity_id(
self,
*,
area_id: str | None = None,
current_entity_id: str | None,
device_id: str | None,
domain: str,
@@ -1256,6 +1272,7 @@ class EntityRegistry(BaseRegistry):
"""
object_id = _async_get_full_entity_name(
self.hass,
area_id=area_id,
device_id=device_id,
fallback=f"{platform}_{unique_id}",
has_entity_name=has_entity_name,
@@ -1285,6 +1302,7 @@ class EntityRegistry(BaseRegistry):
`reserved_entity_ids`.
"""
return self._async_generate_entity_id(
area_id=entry.area_id,
current_entity_id=entry.entity_id,
device_id=entry.device_id,
domain=entry.domain,
@@ -1429,6 +1447,7 @@ class EntityRegistry(BaseRegistry):
if entity_id is None:
entity_id = self._async_generate_entity_id(
area_id=area_id,
current_entity_id=None,
device_id=device_id,
domain=domain,
@@ -1,5 +1,5 @@
# serializer version: 1
# name: test_binary_sensors[binary_sensor.lunar_ddeeff_timer_running-entry]
# name: test_binary_sensors[binary_sensor.kitchen_lunar_ddeeff_timer_running-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
@@ -13,7 +13,7 @@
'disabled_by': None,
'domain': 'binary_sensor',
'entity_category': None,
'entity_id': 'binary_sensor.lunar_ddeeff_timer_running',
'entity_id': 'binary_sensor.kitchen_lunar_ddeeff_timer_running',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -36,14 +36,14 @@
'unit_of_measurement': None,
})
# ---
# name: test_binary_sensors[binary_sensor.lunar_ddeeff_timer_running-state]
# name: test_binary_sensors[binary_sensor.kitchen_lunar_ddeeff_timer_running-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'running',
'friendly_name': 'LUNAR-DDEEFF Timer running',
}),
'context': <ANY>,
'entity_id': 'binary_sensor.lunar_ddeeff_timer_running',
'entity_id': 'binary_sensor.kitchen_lunar_ddeeff_timer_running',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
@@ -1,5 +1,5 @@
# serializer version: 1
# name: test_buttons[button.lunar_ddeeff_reset_timer-entry]
# name: test_buttons[button.kitchen_lunar_ddeeff_reset_timer-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
@@ -13,7 +13,7 @@
'disabled_by': None,
'domain': 'button',
'entity_category': None,
'entity_id': 'button.lunar_ddeeff_reset_timer',
'entity_id': 'button.kitchen_lunar_ddeeff_reset_timer',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -36,20 +36,20 @@
'unit_of_measurement': None,
})
# ---
# name: test_buttons[button.lunar_ddeeff_reset_timer-state]
# name: test_buttons[button.kitchen_lunar_ddeeff_reset_timer-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'friendly_name': 'LUNAR-DDEEFF Reset timer',
}),
'context': <ANY>,
'entity_id': 'button.lunar_ddeeff_reset_timer',
'entity_id': 'button.kitchen_lunar_ddeeff_reset_timer',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'unknown',
})
# ---
# name: test_buttons[button.lunar_ddeeff_start_stop_timer-entry]
# name: test_buttons[button.kitchen_lunar_ddeeff_start_stop_timer-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
@@ -63,7 +63,7 @@
'disabled_by': None,
'domain': 'button',
'entity_category': None,
'entity_id': 'button.lunar_ddeeff_start_stop_timer',
'entity_id': 'button.kitchen_lunar_ddeeff_start_stop_timer',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -86,20 +86,20 @@
'unit_of_measurement': None,
})
# ---
# name: test_buttons[button.lunar_ddeeff_start_stop_timer-state]
# name: test_buttons[button.kitchen_lunar_ddeeff_start_stop_timer-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'friendly_name': 'LUNAR-DDEEFF Start/stop timer',
}),
'context': <ANY>,
'entity_id': 'button.lunar_ddeeff_start_stop_timer',
'entity_id': 'button.kitchen_lunar_ddeeff_start_stop_timer',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'unknown',
})
# ---
# name: test_buttons[button.lunar_ddeeff_tare-entry]
# name: test_buttons[button.kitchen_lunar_ddeeff_tare-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
@@ -113,7 +113,7 @@
'disabled_by': None,
'domain': 'button',
'entity_category': None,
'entity_id': 'button.lunar_ddeeff_tare',
'entity_id': 'button.kitchen_lunar_ddeeff_tare',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -136,13 +136,13 @@
'unit_of_measurement': None,
})
# ---
# name: test_buttons[button.lunar_ddeeff_tare-state]
# name: test_buttons[button.kitchen_lunar_ddeeff_tare-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'friendly_name': 'LUNAR-DDEEFF Tare',
}),
'context': <ANY>,
'entity_id': 'button.lunar_ddeeff_tare',
'entity_id': 'button.kitchen_lunar_ddeeff_tare',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
@@ -1,5 +1,5 @@
# serializer version: 1
# name: test_sensors[sensor.lunar_ddeeff_battery-entry]
# name: test_sensors[sensor.kitchen_lunar_ddeeff_battery-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
@@ -15,7 +15,7 @@
'disabled_by': None,
'domain': 'sensor',
'entity_category': None,
'entity_id': 'sensor.lunar_ddeeff_battery',
'entity_id': 'sensor.kitchen_lunar_ddeeff_battery',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -38,7 +38,7 @@
'unit_of_measurement': '%',
})
# ---
# name: test_sensors[sensor.lunar_ddeeff_battery-state]
# name: test_sensors[sensor.kitchen_lunar_ddeeff_battery-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'battery',
@@ -47,14 +47,14 @@
'unit_of_measurement': '%',
}),
'context': <ANY>,
'entity_id': 'sensor.lunar_ddeeff_battery',
'entity_id': 'sensor.kitchen_lunar_ddeeff_battery',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': '42',
})
# ---
# name: test_sensors[sensor.lunar_ddeeff_volume_flow_rate-entry]
# name: test_sensors[sensor.kitchen_lunar_ddeeff_volume_flow_rate-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
@@ -70,7 +70,7 @@
'disabled_by': None,
'domain': 'sensor',
'entity_category': None,
'entity_id': 'sensor.lunar_ddeeff_volume_flow_rate',
'entity_id': 'sensor.kitchen_lunar_ddeeff_volume_flow_rate',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -96,7 +96,7 @@
'unit_of_measurement': <UnitOfVolumeFlowRate.MILLILITERS_PER_SECOND: 'mL/s'>,
})
# ---
# name: test_sensors[sensor.lunar_ddeeff_volume_flow_rate-state]
# name: test_sensors[sensor.kitchen_lunar_ddeeff_volume_flow_rate-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'volume_flow_rate',
@@ -105,14 +105,14 @@
'unit_of_measurement': <UnitOfVolumeFlowRate.MILLILITERS_PER_SECOND: 'mL/s'>,
}),
'context': <ANY>,
'entity_id': 'sensor.lunar_ddeeff_volume_flow_rate',
'entity_id': 'sensor.kitchen_lunar_ddeeff_volume_flow_rate',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': '1.23',
})
# ---
# name: test_sensors[sensor.lunar_ddeeff_weight-entry]
# name: test_sensors[sensor.kitchen_lunar_ddeeff_weight-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
@@ -128,7 +128,7 @@
'disabled_by': None,
'domain': 'sensor',
'entity_category': None,
'entity_id': 'sensor.lunar_ddeeff_weight',
'entity_id': 'sensor.kitchen_lunar_ddeeff_weight',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -154,7 +154,7 @@
'unit_of_measurement': <UnitOfMass.OUNCES: 'oz'>,
})
# ---
# name: test_sensors[sensor.lunar_ddeeff_weight-state]
# name: test_sensors[sensor.kitchen_lunar_ddeeff_weight-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'weight',
@@ -163,7 +163,7 @@
'unit_of_measurement': <UnitOfMass.OUNCES: 'oz'>,
}),
'context': <ANY>,
'entity_id': 'sensor.lunar_ddeeff_weight',
'entity_id': 'sensor.kitchen_lunar_ddeeff_weight',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
+3 -3
View File
@@ -55,7 +55,7 @@ async def test_button_presses(
BUTTON_DOMAIN,
SERVICE_PRESS,
{
ATTR_ENTITY_ID: f"button.lunar_ddeeff_{button}",
ATTR_ENTITY_ID: f"button.kitchen_lunar_ddeeff_{button}",
},
blocking=True,
)
@@ -75,7 +75,7 @@ async def test_buttons_unavailable_on_disconnected_scale(
await setup_integration(hass, mock_config_entry)
for button in BUTTONS:
state = hass.states.get(f"button.lunar_ddeeff_{button}")
state = hass.states.get(f"button.kitchen_lunar_ddeeff_{button}")
assert state
assert state.state == STATE_UNKNOWN
@@ -85,6 +85,6 @@ async def test_buttons_unavailable_on_disconnected_scale(
await hass.async_block_till_done()
for button in BUTTONS:
state = hass.states.get(f"button.lunar_ddeeff_{button}")
state = hass.states.get(f"button.kitchen_lunar_ddeeff_{button}")
assert state
assert state.state == STATE_UNAVAILABLE
+2 -2
View File
@@ -41,7 +41,7 @@ async def test_restore_state(
) -> None:
"""Test battery sensor restore state."""
mock_scale.device_state = None
entity_id = "sensor.lunar_ddeeff_battery"
entity_id = "sensor.kitchen_lunar_ddeeff_battery"
mock_restore_cache_with_extra_data(
hass,
@@ -73,7 +73,7 @@ async def test_battery_available_within_session_after_disconnect(
mock_config_entry: MockConfigEntry,
) -> None:
"""Test battery stays available on disconnect when no restore data exists."""
entity_id = "sensor.lunar_ddeeff_battery"
entity_id = "sensor.kitchen_lunar_ddeeff_battery"
await setup_integration(hass, mock_config_entry)
@@ -1,5 +1,5 @@
# serializer version: 1
# name: test_climate_entities[climate.living_room-entry]
# name: test_climate_entities[climate.living_room_living_room-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
@@ -23,7 +23,7 @@
'disabled_by': None,
'domain': 'climate',
'entity_category': None,
'entity_id': 'climate.living_room',
'entity_id': 'climate.living_room_living_room',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -46,7 +46,7 @@
'unit_of_measurement': None,
})
# ---
# name: test_climate_entities[climate.living_room-state]
# name: test_climate_entities[climate.living_room_living_room-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'current_humidity': 50.0,
@@ -65,7 +65,7 @@
'temperature': 24.0,
}),
'context': <ANY>,
'entity_id': 'climate.living_room',
'entity_id': 'climate.living_room_living_room',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
+18 -9
View File
@@ -213,7 +213,7 @@ async def test_zone_set_temperature(
await hass.services.async_call(
CLIMATE_DOMAIN,
SERVICE_SET_TEMPERATURE,
{ATTR_ENTITY_ID: "climate.living_room", ATTR_TEMPERATURE: 23.0},
{ATTR_ENTITY_ID: "climate.living_room_living_room", ATTR_TEMPERATURE: 23.0},
blocking=True,
)
@@ -232,7 +232,7 @@ async def test_zone_set_temperature_api_error(
await hass.services.async_call(
CLIMATE_DOMAIN,
SERVICE_SET_TEMPERATURE,
{ATTR_ENTITY_ID: "climate.living_room", ATTR_TEMPERATURE: 23.0},
{ATTR_ENTITY_ID: "climate.living_room_living_room", ATTR_TEMPERATURE: 23.0},
blocking=True,
)
@@ -269,7 +269,10 @@ async def test_zone_set_hvac_mode_on(
await hass.services.async_call(
CLIMATE_DOMAIN,
SERVICE_SET_HVAC_MODE,
{ATTR_ENTITY_ID: "climate.living_room", ATTR_HVAC_MODE: HVACMode.COOL},
{
ATTR_ENTITY_ID: "climate.living_room_living_room",
ATTR_HVAC_MODE: HVACMode.COOL,
},
blocking=True,
)
@@ -285,7 +288,10 @@ async def test_zone_set_hvac_mode_off(
await hass.services.async_call(
CLIMATE_DOMAIN,
SERVICE_SET_HVAC_MODE,
{ATTR_ENTITY_ID: "climate.living_room", ATTR_HVAC_MODE: HVACMode.OFF},
{
ATTR_ENTITY_ID: "climate.living_room_living_room",
ATTR_HVAC_MODE: HVACMode.OFF,
},
blocking=True,
)
@@ -304,7 +310,10 @@ async def test_zone_set_hvac_mode_api_error(
await hass.services.async_call(
CLIMATE_DOMAIN,
SERVICE_SET_HVAC_MODE,
{ATTR_ENTITY_ID: "climate.living_room", ATTR_HVAC_MODE: HVACMode.OFF},
{
ATTR_ENTITY_ID: "climate.living_room_living_room",
ATTR_HVAC_MODE: HVACMode.OFF,
},
blocking=True,
)
@@ -342,7 +351,7 @@ async def test_zone_hvac_mode_unmapped(
with patch("homeassistant.components.actron_air.PLATFORMS", [Platform.CLIMATE]):
await setup_integration(hass, mock_config_entry)
state = hass.states.get("climate.living_room")
state = hass.states.get("climate.living_room_living_room")
assert state.state == "unknown"
@@ -361,7 +370,7 @@ async def test_zone_hvac_mode_inactive(
with patch("homeassistant.components.actron_air.PLATFORMS", [Platform.CLIMATE]):
await setup_integration(hass, mock_config_entry)
state = hass.states.get("climate.living_room")
state = hass.states.get("climate.living_room_living_room")
assert state.state == "off"
@@ -449,7 +458,7 @@ async def test_zone_hvac_modes_with_dry(
with patch("homeassistant.components.actron_air.PLATFORMS", [Platform.CLIMATE]):
await setup_integration(hass, mock_config_entry)
state = hass.states.get("climate.living_room")
state = hass.states.get("climate.living_room_living_room")
assert state.attributes["hvac_modes"] == [
HVACMode.COOL,
HVACMode.HEAT,
@@ -474,7 +483,7 @@ async def test_zone_hvac_modes_no_mode_support(
with patch("homeassistant.components.actron_air.PLATFORMS", [Platform.CLIMATE]):
await setup_integration(hass, mock_config_entry)
state = hass.states.get("climate.living_room")
state = hass.states.get("climate.living_room_living_room")
assert state.attributes["hvac_modes"] == [
HVACMode.COOL,
HVACMode.HEAT,
@@ -1,5 +1,5 @@
# serializer version: 1
# name: test_state[True][select.my_water_heater_hot_water_plus_level-entry]
# name: test_state[True][select.basement_my_water_heater_hot_water_plus_level-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
@@ -20,7 +20,7 @@
'disabled_by': None,
'domain': 'select',
'entity_category': None,
'entity_id': 'select.my_water_heater_hot_water_plus_level',
'entity_id': 'select.basement_my_water_heater_hot_water_plus_level',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -43,7 +43,7 @@
'unit_of_measurement': None,
})
# ---
# name: test_state[True][select.my_water_heater_hot_water_plus_level-state]
# name: test_state[True][select.basement_my_water_heater_hot_water_plus_level-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'friendly_name': 'My water heater Hot Water+ level',
@@ -55,7 +55,7 @@
]),
}),
'context': <ANY>,
'entity_id': 'select.my_water_heater_hot_water_plus_level',
'entity_id': 'select.basement_my_water_heater_hot_water_plus_level',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
@@ -1,5 +1,5 @@
# serializer version: 1
# name: test_state[sensor.my_water_heater_energy_usage-entry]
# name: test_state[sensor.basement_my_water_heater_energy_usage-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
@@ -15,7 +15,7 @@
'disabled_by': None,
'domain': 'sensor',
'entity_category': None,
'entity_id': 'sensor.my_water_heater_energy_usage',
'entity_id': 'sensor.basement_my_water_heater_energy_usage',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -41,7 +41,7 @@
'unit_of_measurement': <UnitOfEnergy.KILO_WATT_HOUR: 'kWh'>,
})
# ---
# name: test_state[sensor.my_water_heater_energy_usage-state]
# name: test_state[sensor.basement_my_water_heater_energy_usage-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'energy',
@@ -50,14 +50,14 @@
'unit_of_measurement': <UnitOfEnergy.KILO_WATT_HOUR: 'kWh'>,
}),
'context': <ANY>,
'entity_id': 'sensor.my_water_heater_energy_usage',
'entity_id': 'sensor.basement_my_water_heater_energy_usage',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': '132.825',
})
# ---
# name: test_state[sensor.my_water_heater_hot_water_availability-entry]
# name: test_state[sensor.basement_my_water_heater_hot_water_availability-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
@@ -71,7 +71,7 @@
'disabled_by': None,
'domain': 'sensor',
'entity_category': None,
'entity_id': 'sensor.my_water_heater_hot_water_availability',
'entity_id': 'sensor.basement_my_water_heater_hot_water_availability',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -94,14 +94,14 @@
'unit_of_measurement': '%',
})
# ---
# name: test_state[sensor.my_water_heater_hot_water_availability-state]
# name: test_state[sensor.basement_my_water_heater_hot_water_availability-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'friendly_name': 'My water heater Hot water availability',
'unit_of_measurement': '%',
}),
'context': <ANY>,
'entity_id': 'sensor.my_water_heater_hot_water_availability',
'entity_id': 'sensor.basement_my_water_heater_hot_water_availability',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
@@ -1,5 +1,5 @@
# serializer version: 1
# name: test_state[False][water_heater.my_water_heater-entry]
# name: test_state[False][water_heater.basement_my_water_heater-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
@@ -16,7 +16,7 @@
'disabled_by': None,
'domain': 'water_heater',
'entity_category': None,
'entity_id': 'water_heater.my_water_heater',
'entity_id': 'water_heater.basement_my_water_heater',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -39,7 +39,7 @@
'unit_of_measurement': None,
})
# ---
# name: test_state[False][water_heater.my_water_heater-state]
# name: test_state[False][water_heater.basement_my_water_heater-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'away_mode': 'off',
@@ -53,14 +53,14 @@
'temperature': 130,
}),
'context': <ANY>,
'entity_id': 'water_heater.my_water_heater',
'entity_id': 'water_heater.basement_my_water_heater',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'electric',
})
# ---
# name: test_state[True][water_heater.my_water_heater-entry]
# name: test_state[True][water_heater.basement_my_water_heater-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
@@ -82,7 +82,7 @@
'disabled_by': None,
'domain': 'water_heater',
'entity_category': None,
'entity_id': 'water_heater.my_water_heater',
'entity_id': 'water_heater.basement_my_water_heater',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -105,7 +105,7 @@
'unit_of_measurement': None,
})
# ---
# name: test_state[True][water_heater.my_water_heater-state]
# name: test_state[True][water_heater.basement_my_water_heater-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'away_mode': 'off',
@@ -125,7 +125,7 @@
'temperature': 130,
}),
'context': <ANY>,
'entity_id': 'water_heater.my_water_heater',
'entity_id': 'water_heater.basement_my_water_heater',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
+1 -1
View File
@@ -64,7 +64,7 @@ async def test_set_hot_water_plus_level(
SELECT_DOMAIN,
SERVICE_SELECT_OPTION,
{
ATTR_ENTITY_ID: "select.my_water_heater_hot_water_plus_level",
ATTR_ENTITY_ID: "select.basement_my_water_heater_hot_water_plus_level",
ATTR_OPTION: hass_level,
},
)
@@ -57,7 +57,7 @@ async def test_state_away_mode_unsupported(
hass: HomeAssistant, init_integration: MockConfigEntry
) -> None:
"""Test away mode unsupported if water heater lacks vacation mode."""
state = hass.states.get("water_heater.my_water_heater")
state = hass.states.get("water_heater.basement_my_water_heater")
assert (
state.attributes.get(ATTR_SUPPORTED_FEATURES)
== WaterHeaterEntityFeature.TARGET_TEMPERATURE
@@ -85,7 +85,7 @@ async def test_set_operation_mode(
WATER_HEATER_DOMAIN,
SERVICE_SET_OPERATION_MODE,
{
ATTR_ENTITY_ID: "water_heater.my_water_heater",
ATTR_ENTITY_ID: "water_heater.basement_my_water_heater",
ATTR_OPERATION_MODE: hass_mode,
},
)
@@ -105,7 +105,7 @@ async def test_unsupported_operation_mode(
WATER_HEATER_DOMAIN,
SERVICE_SET_OPERATION_MODE,
{
ATTR_ENTITY_ID: "water_heater.my_water_heater",
ATTR_ENTITY_ID: "water_heater.basement_my_water_heater",
ATTR_OPERATION_MODE: "unsupported_mode",
},
blocking=True,
@@ -121,7 +121,10 @@ async def test_set_temperature(
await hass.services.async_call(
WATER_HEATER_DOMAIN,
SERVICE_SET_TEMPERATURE,
{ATTR_ENTITY_ID: "water_heater.my_water_heater", ATTR_TEMPERATURE: 120},
{
ATTR_ENTITY_ID: "water_heater.basement_my_water_heater",
ATTR_TEMPERATURE: 120,
},
)
await hass.async_block_till_done()
@@ -149,7 +152,7 @@ async def test_away_mode(
WATER_HEATER_DOMAIN,
SERVICE_SET_AWAY_MODE,
{
ATTR_ENTITY_ID: "water_heater.my_water_heater",
ATTR_ENTITY_ID: "water_heater.basement_my_water_heater",
ATTR_AWAY_MODE: hass_away_mode,
},
)
@@ -58,5 +58,5 @@ async def test_keyboard_focus_entity_created_on_setup(
await hass.config_entries.async_setup(entry.entry_id)
await hass.async_block_till_done()
state = hass.states.get("binary_sensor.living_room_keyboard_focus")
state = hass.states.get("binary_sensor.living_room_living_room_keyboard_focus")
assert state is not None
+159 -35
View File
@@ -40,17 +40,32 @@ async def test_doorsense(hass: HomeAssistant) -> None:
await _create_august_with_devices(hass, [lock_one])
states = hass.states
assert states.get("binary_sensor.online_with_doorsense_name_door").state == STATE_ON
assert (
states.get(
"binary_sensor.online_with_doorsense_name_online_with_doorsense_name_door"
).state
== STATE_ON
)
data = {ATTR_ENTITY_ID: "lock.online_with_doorsense_name"}
data = {
ATTR_ENTITY_ID: "lock.online_with_doorsense_name_online_with_doorsense_name"
}
await hass.services.async_call(LOCK_DOMAIN, SERVICE_UNLOCK, data, blocking=True)
assert states.get("binary_sensor.online_with_doorsense_name_door").state == STATE_ON
assert (
states.get(
"binary_sensor.online_with_doorsense_name_online_with_doorsense_name_door"
).state
== STATE_ON
)
await hass.services.async_call(LOCK_DOMAIN, SERVICE_LOCK, data, blocking=True)
assert (
states.get("binary_sensor.online_with_doorsense_name_door").state == STATE_OFF
states.get(
"binary_sensor.online_with_doorsense_name_online_with_doorsense_name_door"
).state
== STATE_OFF
)
@@ -65,7 +80,9 @@ async def test_lock_bridge_offline(hass: HomeAssistant) -> None:
await _create_august_with_devices(hass, [lock_one], activities=activities)
states = hass.states
assert (
states.get("binary_sensor.online_with_doorsense_name_door").state
states.get(
"binary_sensor.online_with_doorsense_name_online_with_doorsense_name_door"
).state
== STATE_UNAVAILABLE
)
@@ -76,17 +93,37 @@ async def test_create_doorbell(hass: HomeAssistant) -> None:
await _create_august_with_devices(hass, [doorbell_one])
states = hass.states
assert states.get("binary_sensor.k98gidt45gul_name_motion").state == STATE_OFF
assert (
states.get("binary_sensor.k98gidt45gul_name_image_capture").state == STATE_OFF
states.get("binary_sensor.k98gidt45gul_name_k98gidt45gul_name_motion").state
== STATE_OFF
)
assert states.get("binary_sensor.k98gidt45gul_name_connectivity").state == STATE_ON
assert (
states.get("binary_sensor.k98gidt45gul_name_doorbell_ding").state == STATE_OFF
states.get(
"binary_sensor.k98gidt45gul_name_k98gidt45gul_name_image_capture"
).state
== STATE_OFF
)
assert states.get("binary_sensor.k98gidt45gul_name_motion").state == STATE_OFF
assert (
states.get("binary_sensor.k98gidt45gul_name_image_capture").state == STATE_OFF
states.get(
"binary_sensor.k98gidt45gul_name_k98gidt45gul_name_connectivity"
).state
== STATE_ON
)
assert (
states.get(
"binary_sensor.k98gidt45gul_name_k98gidt45gul_name_doorbell_ding"
).state
== STATE_OFF
)
assert (
states.get("binary_sensor.k98gidt45gul_name_k98gidt45gul_name_motion").state
== STATE_OFF
)
assert (
states.get(
"binary_sensor.k98gidt45gul_name_k98gidt45gul_name_image_capture"
).state
== STATE_OFF
)
@@ -96,10 +133,17 @@ async def test_create_doorbell_offline(hass: HomeAssistant) -> None:
await _create_august_with_devices(hass, [doorbell_one])
states = hass.states
assert states.get("binary_sensor.tmt100_name_motion").state == STATE_UNAVAILABLE
assert states.get("binary_sensor.tmt100_name_connectivity").state == STATE_OFF
assert (
states.get("binary_sensor.tmt100_name_doorbell_ding").state == STATE_UNAVAILABLE
states.get("binary_sensor.tmt100_name_tmt100_name_motion").state
== STATE_UNAVAILABLE
)
assert (
states.get("binary_sensor.tmt100_name_tmt100_name_connectivity").state
== STATE_OFF
)
assert (
states.get("binary_sensor.tmt100_name_tmt100_name_doorbell_ding").state
== STATE_UNAVAILABLE
)
@@ -114,15 +158,29 @@ async def test_create_doorbell_with_motion(
await _create_august_with_devices(hass, [doorbell_one], activities=activities)
states = hass.states
assert states.get("binary_sensor.k98gidt45gul_name_motion").state == STATE_ON
assert states.get("binary_sensor.k98gidt45gul_name_connectivity").state == STATE_ON
assert (
states.get("binary_sensor.k98gidt45gul_name_doorbell_ding").state == STATE_OFF
states.get("binary_sensor.k98gidt45gul_name_k98gidt45gul_name_motion").state
== STATE_ON
)
assert (
states.get(
"binary_sensor.k98gidt45gul_name_k98gidt45gul_name_connectivity"
).state
== STATE_ON
)
assert (
states.get(
"binary_sensor.k98gidt45gul_name_k98gidt45gul_name_doorbell_ding"
).state
== STATE_OFF
)
freezer.tick(40)
async_fire_time_changed(hass)
await hass.async_block_till_done()
assert states.get("binary_sensor.k98gidt45gul_name_motion").state == STATE_OFF
assert (
states.get("binary_sensor.k98gidt45gul_name_k98gidt45gul_name_motion").state
== STATE_OFF
)
async def test_doorbell_update_via_pubnub(
@@ -135,9 +193,15 @@ async def test_doorbell_update_via_pubnub(
await _create_august_with_devices(hass, [doorbell_one], pubnub=pubnub)
assert doorbell_one.pubsub_channel == "7c7a6672-59c8-3333-ffff-dcd98705cccc"
states = hass.states
assert states.get("binary_sensor.k98gidt45gul_name_motion").state == STATE_OFF
assert (
states.get("binary_sensor.k98gidt45gul_name_doorbell_ding").state == STATE_OFF
states.get("binary_sensor.k98gidt45gul_name_k98gidt45gul_name_motion").state
== STATE_OFF
)
assert (
states.get(
"binary_sensor.k98gidt45gul_name_k98gidt45gul_name_doorbell_ding"
).state
== STATE_OFF
)
pubnub.message(
@@ -161,7 +225,12 @@ async def test_doorbell_update_via_pubnub(
await hass.async_block_till_done()
assert states.get("binary_sensor.k98gidt45gul_name_image_capture").state == STATE_ON
assert (
states.get(
"binary_sensor.k98gidt45gul_name_k98gidt45gul_name_image_capture"
).state
== STATE_ON
)
pubnub.message(
pubnub,
@@ -195,10 +264,16 @@ async def test_doorbell_update_via_pubnub(
await hass.async_block_till_done()
assert states.get("binary_sensor.k98gidt45gul_name_motion").state == STATE_ON
assert (
states.get("binary_sensor.k98gidt45gul_name_k98gidt45gul_name_motion").state
== STATE_ON
)
assert (
states.get("binary_sensor.k98gidt45gul_name_doorbell_ding").state == STATE_OFF
states.get(
"binary_sensor.k98gidt45gul_name_k98gidt45gul_name_doorbell_ding"
).state
== STATE_OFF
)
freezer.tick(40)
@@ -206,7 +281,10 @@ async def test_doorbell_update_via_pubnub(
await hass.async_block_till_done()
assert (
states.get("binary_sensor.k98gidt45gul_name_image_capture").state == STATE_OFF
states.get(
"binary_sensor.k98gidt45gul_name_k98gidt45gul_name_image_capture"
).state
== STATE_OFF
)
pubnub.message(
@@ -221,13 +299,21 @@ async def test_doorbell_update_via_pubnub(
)
await hass.async_block_till_done()
assert states.get("binary_sensor.k98gidt45gul_name_doorbell_ding").state == STATE_ON
assert (
states.get(
"binary_sensor.k98gidt45gul_name_k98gidt45gul_name_doorbell_ding"
).state
== STATE_ON
)
freezer.tick(40)
async_fire_time_changed(hass)
await hass.async_block_till_done()
assert (
states.get("binary_sensor.k98gidt45gul_name_doorbell_ding").state == STATE_OFF
states.get(
"binary_sensor.k98gidt45gul_name_k98gidt45gul_name_doorbell_ding"
).state
== STATE_OFF
)
@@ -254,7 +340,12 @@ async def test_door_sense_update_via_pubnub(hass: HomeAssistant) -> None:
)
states = hass.states
assert states.get("binary_sensor.online_with_doorsense_name_door").state == STATE_ON
assert (
states.get(
"binary_sensor.online_with_doorsense_name_online_with_doorsense_name_door"
).state
== STATE_ON
)
pubnub.message(
pubnub,
@@ -267,7 +358,10 @@ async def test_door_sense_update_via_pubnub(hass: HomeAssistant) -> None:
await hass.async_block_till_done()
assert (
states.get("binary_sensor.online_with_doorsense_name_door").state == STATE_OFF
states.get(
"binary_sensor.online_with_doorsense_name_online_with_doorsense_name_door"
).state
== STATE_OFF
)
pubnub.message(
@@ -279,22 +373,42 @@ async def test_door_sense_update_via_pubnub(hass: HomeAssistant) -> None:
),
)
await hass.async_block_till_done()
assert states.get("binary_sensor.online_with_doorsense_name_door").state == STATE_ON
assert (
states.get(
"binary_sensor.online_with_doorsense_name_online_with_doorsense_name_door"
).state
== STATE_ON
)
async_fire_time_changed(hass, dt_util.utcnow() + datetime.timedelta(seconds=30))
await hass.async_block_till_done()
assert states.get("binary_sensor.online_with_doorsense_name_door").state == STATE_ON
assert (
states.get(
"binary_sensor.online_with_doorsense_name_online_with_doorsense_name_door"
).state
== STATE_ON
)
pubnub.connected = True
async_fire_time_changed(hass, dt_util.utcnow() + datetime.timedelta(seconds=30))
await hass.async_block_till_done()
assert states.get("binary_sensor.online_with_doorsense_name_door").state == STATE_ON
assert (
states.get(
"binary_sensor.online_with_doorsense_name_online_with_doorsense_name_door"
).state
== STATE_ON
)
# Ensure pubnub status is always preserved
async_fire_time_changed(hass, dt_util.utcnow() + datetime.timedelta(hours=2))
await hass.async_block_till_done()
assert states.get("binary_sensor.online_with_doorsense_name_door").state == STATE_ON
assert (
states.get(
"binary_sensor.online_with_doorsense_name_online_with_doorsense_name_door"
).state
== STATE_ON
)
pubnub.message(
pubnub,
@@ -305,11 +419,21 @@ async def test_door_sense_update_via_pubnub(hass: HomeAssistant) -> None:
),
)
await hass.async_block_till_done()
assert states.get("binary_sensor.online_with_doorsense_name_door").state == STATE_ON
assert (
states.get(
"binary_sensor.online_with_doorsense_name_online_with_doorsense_name_door"
).state
== STATE_ON
)
async_fire_time_changed(hass, dt_util.utcnow() + datetime.timedelta(hours=4))
await hass.async_block_till_done()
assert states.get("binary_sensor.online_with_doorsense_name_door").state == STATE_ON
assert (
states.get(
"binary_sensor.online_with_doorsense_name_online_with_doorsense_name_door"
).state
== STATE_ON
)
await hass.config_entries.async_unload(config_entry.entry_id)
await hass.async_block_till_done()
@@ -323,7 +447,7 @@ async def test_create_lock_with_doorbell(hass: HomeAssistant) -> None:
states = hass.states
assert (
states.get(
"binary_sensor.a6697750d607098bae8d6baa11ef8063_name_doorbell_ding"
"binary_sensor.a6697750d607098bae8d6baa11ef8063_name_a6697750d607098bae8d6baa11ef8063_name_doorbell_ding"
).state
== STATE_OFF
)
+1 -1
View File
@@ -13,7 +13,7 @@ async def test_wake_lock(hass: HomeAssistant) -> None:
hass, "get_lock.online_with_doorsense.json"
)
_, api_instance, _ = await _create_august_api_with_devices(hass, [lock_one])
entity_id = "button.online_with_doorsense_name_wake"
entity_id = "button.online_with_doorsense_name_online_with_doorsense_name_wake"
binary_sensor_online_with_doorsense_name = hass.states.get(entity_id)
assert binary_sensor_online_with_doorsense_name is not None
api_instance.async_status_async.reset_mock()
+9 -7
View File
@@ -25,7 +25,9 @@ async def test_create_doorbell(
):
await _create_august_with_devices(hass, [doorbell_one], brand=Brand.AUGUST)
camera_state = hass.states.get("camera.k98gidt45gul_name_camera")
camera_state = hass.states.get(
"camera.k98gidt45gul_name_k98gidt45gul_name_camera"
)
assert camera_state.state == CameraState.IDLE
url = camera_state.attributes["entity_picture"]
@@ -53,9 +55,9 @@ async def test_doorbell_refresh_content_token_recover(
[doorbell_two],
brand=Brand.YALE_HOME,
)
url = hass.states.get("camera.k98gidt45gul_name_camera").attributes[
"entity_picture"
]
url = hass.states.get(
"camera.k98gidt45gul_name_k98gidt45gul_name_camera"
).attributes["entity_picture"]
client = await hass_client_no_auth()
resp = await client.get(url)
@@ -80,9 +82,9 @@ async def test_doorbell_refresh_content_token_fail(
[doorbell_two],
brand=Brand.YALE_HOME,
)
url = hass.states.get("camera.k98gidt45gul_name_camera").attributes[
"entity_picture"
]
url = hass.states.get(
"camera.k98gidt45gul_name_k98gidt45gul_name_camera"
).attributes["entity_picture"]
client = await hass_client_no_auth()
resp = await client.get(url)
+24 -14
View File
@@ -24,10 +24,12 @@ async def test_create_doorbell(hass: HomeAssistant) -> None:
doorbell_one = await _mock_doorbell_from_fixture(hass, "get_doorbell.json")
await _create_august_with_devices(hass, [doorbell_one])
motion_state = hass.states.get("event.k98gidt45gul_name_motion")
motion_state = hass.states.get("event.k98gidt45gul_name_k98gidt45gul_name_motion")
assert motion_state is not None
assert motion_state.state == STATE_UNKNOWN
doorbell_state = hass.states.get("event.k98gidt45gul_name_doorbell")
doorbell_state = hass.states.get(
"event.k98gidt45gul_name_k98gidt45gul_name_doorbell"
)
assert doorbell_state is not None
assert doorbell_state.state == STATE_UNKNOWN
@@ -36,10 +38,10 @@ async def test_create_doorbell_offline(hass: HomeAssistant) -> None:
"""Test creation of a doorbell that is offline."""
doorbell_one = await _mock_doorbell_from_fixture(hass, "get_doorbell.offline.json")
await _create_august_with_devices(hass, [doorbell_one])
motion_state = hass.states.get("event.tmt100_name_motion")
motion_state = hass.states.get("event.tmt100_name_tmt100_name_motion")
assert motion_state is not None
assert motion_state.state == STATE_UNAVAILABLE
doorbell_state = hass.states.get("event.tmt100_name_doorbell")
doorbell_state = hass.states.get("event.tmt100_name_tmt100_name_doorbell")
assert doorbell_state is not None
assert doorbell_state.state == STATE_UNAVAILABLE
@@ -54,18 +56,20 @@ async def test_create_doorbell_with_motion(
)
await _create_august_with_devices(hass, [doorbell_one], activities=activities)
motion_state = hass.states.get("event.k98gidt45gul_name_motion")
motion_state = hass.states.get("event.k98gidt45gul_name_k98gidt45gul_name_motion")
assert motion_state is not None
assert motion_state.state != STATE_UNKNOWN
isotime = motion_state.state
doorbell_state = hass.states.get("event.k98gidt45gul_name_doorbell")
doorbell_state = hass.states.get(
"event.k98gidt45gul_name_k98gidt45gul_name_doorbell"
)
assert doorbell_state is not None
assert doorbell_state.state == STATE_UNKNOWN
freezer.tick(40)
async_fire_time_changed(hass)
await hass.async_block_till_done()
motion_state = hass.states.get("event.k98gidt45gul_name_motion")
motion_state = hass.states.get("event.k98gidt45gul_name_k98gidt45gul_name_motion")
assert motion_state.state == isotime
@@ -79,10 +83,12 @@ async def test_doorbell_update_via_pubnub(
await _create_august_with_devices(hass, [doorbell_one], pubnub=pubnub)
assert doorbell_one.pubsub_channel == "7c7a6672-59c8-3333-ffff-dcd98705cccc"
motion_state = hass.states.get("event.k98gidt45gul_name_motion")
motion_state = hass.states.get("event.k98gidt45gul_name_k98gidt45gul_name_motion")
assert motion_state is not None
assert motion_state.state == STATE_UNKNOWN
doorbell_state = hass.states.get("event.k98gidt45gul_name_doorbell")
doorbell_state = hass.states.get(
"event.k98gidt45gul_name_k98gidt45gul_name_doorbell"
)
assert doorbell_state is not None
assert doorbell_state.state == STATE_UNKNOWN
@@ -118,7 +124,7 @@ async def test_doorbell_update_via_pubnub(
await hass.async_block_till_done()
motion_state = hass.states.get("event.k98gidt45gul_name_motion")
motion_state = hass.states.get("event.k98gidt45gul_name_k98gidt45gul_name_motion")
assert motion_state is not None
assert motion_state.state != STATE_UNKNOWN
isotime = motion_state.state
@@ -127,7 +133,7 @@ async def test_doorbell_update_via_pubnub(
async_fire_time_changed(hass)
await hass.async_block_till_done()
motion_state = hass.states.get("event.k98gidt45gul_name_motion")
motion_state = hass.states.get("event.k98gidt45gul_name_k98gidt45gul_name_motion")
assert motion_state is not None
assert motion_state.state != STATE_UNKNOWN
@@ -143,7 +149,9 @@ async def test_doorbell_update_via_pubnub(
)
await hass.async_block_till_done()
doorbell_state = hass.states.get("event.k98gidt45gul_name_doorbell")
doorbell_state = hass.states.get(
"event.k98gidt45gul_name_k98gidt45gul_name_doorbell"
)
assert doorbell_state is not None
assert doorbell_state.state != STATE_UNKNOWN
isotime = motion_state.state
@@ -152,7 +160,9 @@ async def test_doorbell_update_via_pubnub(
async_fire_time_changed(hass)
await hass.async_block_till_done()
doorbell_state = hass.states.get("event.k98gidt45gul_name_doorbell")
doorbell_state = hass.states.get(
"event.k98gidt45gul_name_k98gidt45gul_name_doorbell"
)
assert doorbell_state is not None
assert doorbell_state.state != STATE_UNKNOWN
assert motion_state.state == isotime
@@ -164,7 +174,7 @@ async def test_create_lock_with_doorbell(hass: HomeAssistant) -> None:
await _create_august_with_devices(hass, [lock_one])
doorbell_state = hass.states.get(
"event.a6697750d607098bae8d6baa11ef8063_name_doorbell"
"event.a6697750d607098bae8d6baa11ef8063_name_a6697750d607098bae8d6baa11ef8063_name_doorbell"
)
assert doorbell_state is not None
assert doorbell_state.state == STATE_UNKNOWN
+16 -8
View File
@@ -100,7 +100,9 @@ async def test_unlock_throws_august_api_http_error(hass: HomeAssistant) -> None:
"unlock_return_activities": _unlock_return_activities_side_effect
},
)
data = {ATTR_ENTITY_ID: "lock.a6697750d607098bae8d6baa11ef8063_name"}
data = {
ATTR_ENTITY_ID: "lock.a6697750d607098bae8d6baa11ef8063_name_a6697750d607098bae8d6baa11ef8063_name"
}
with pytest.raises(
HomeAssistantError,
@@ -130,7 +132,9 @@ async def test_lock_throws_august_api_http_error(hass: HomeAssistant) -> None:
"lock_return_activities": _lock_return_activities_side_effect
},
)
data = {ATTR_ENTITY_ID: "lock.a6697750d607098bae8d6baa11ef8063_name"}
data = {
ATTR_ENTITY_ID: "lock.a6697750d607098bae8d6baa11ef8063_name_a6697750d607098bae8d6baa11ef8063_name"
}
with pytest.raises(
HomeAssistantError,
match=(
@@ -147,7 +151,9 @@ async def test_open_throws_hass_service_not_supported_error(
"""Test open throws correct error on entity does not support this service error."""
mocked_lock_detail = await _mock_operative_august_lock_detail(hass)
await _create_august_with_devices(hass, [mocked_lock_detail])
data = {ATTR_ENTITY_ID: "lock.a6697750d607098bae8d6baa11ef8063_name"}
data = {
ATTR_ENTITY_ID: "lock.a6697750d607098bae8d6baa11ef8063_name_a6697750d607098bae8d6baa11ef8063_name"
}
with pytest.raises(HomeAssistantError):
await hass.services.async_call(LOCK_DOMAIN, SERVICE_OPEN, data, blocking=True)
@@ -160,10 +166,10 @@ async def test_inoperative_locks_are_filtered_out(hass: HomeAssistant) -> None:
hass, [august_operative_lock, august_inoperative_lock]
)
lock_abc_name = hass.states.get("lock.abc_name")
lock_abc_name = hass.states.get("lock.abc_name_abc_name")
assert lock_abc_name is None
lock_a6697750d607098bae8d6baa11ef8063_name = hass.states.get(
"lock.a6697750d607098bae8d6baa11ef8063_name"
"lock.a6697750d607098bae8d6baa11ef8063_name_a6697750d607098bae8d6baa11ef8063_name"
)
assert lock_a6697750d607098bae8d6baa11ef8063_name.state == LockState.LOCKED
@@ -175,11 +181,11 @@ async def test_lock_has_doorsense(hass: HomeAssistant) -> None:
await _create_august_with_devices(hass, [doorsenselock, nodoorsenselock])
binary_sensor_online_with_doorsense_name_open = hass.states.get(
"binary_sensor.online_with_doorsense_name_door"
"binary_sensor.online_with_doorsense_name_online_with_doorsense_name_door"
)
assert binary_sensor_online_with_doorsense_name_open.state == STATE_ON
binary_sensor_missing_doorsense_id_name_open = hass.states.get(
"binary_sensor.missing_with_doorsense_name_door"
"binary_sensor.missing_with_doorsense_name_missing_with_doorsense_name_door"
)
assert binary_sensor_missing_doorsense_id_name_open is None
@@ -234,7 +240,9 @@ async def test_device_remove_devices(
assert await async_setup_component(hass, "config", {})
august_operative_lock = await _mock_operative_august_lock_detail(hass)
config_entry, _ = await _create_august_with_devices(hass, [august_operative_lock])
entity = entity_registry.entities["lock.a6697750d607098bae8d6baa11ef8063_name"]
entity = entity_registry.entities[
"lock.a6697750d607098bae8d6baa11ef8063_name_a6697750d607098bae8d6baa11ef8063_name"
]
device_entry = device_registry.async_get(entity.device_id)
client = await hass_ws_client(hass)
+137 -40
View File
@@ -57,7 +57,9 @@ async def test_lock_changed_by(hass: HomeAssistant) -> None:
activities = await _mock_activities_from_fixture(hass, "get_activity.lock.json")
await _create_august_with_devices(hass, [lock_one], activities=activities)
lock_state = hass.states.get("lock.online_with_doorsense_name")
lock_state = hass.states.get(
"lock.online_with_doorsense_name_online_with_doorsense_name"
)
assert lock_state.state == LockState.LOCKED
assert lock_state.attributes["changed_by"] == "Your favorite elven princess"
@@ -70,7 +72,12 @@ async def test_state_locking(hass: HomeAssistant) -> None:
activities = await _mock_activities_from_fixture(hass, "get_activity.locking.json")
await _create_august_with_devices(hass, [lock_one], activities=activities)
assert hass.states.get("lock.online_with_doorsense_name").state == LockState.LOCKING
assert (
hass.states.get(
"lock.online_with_doorsense_name_online_with_doorsense_name"
).state
== LockState.LOCKING
)
async def test_state_unlocking(hass: HomeAssistant) -> None:
@@ -83,7 +90,10 @@ async def test_state_unlocking(hass: HomeAssistant) -> None:
await _create_august_with_devices(hass, [lock_one], activities=activities)
assert (
hass.states.get("lock.online_with_doorsense_name").state == LockState.UNLOCKING
hass.states.get(
"lock.online_with_doorsense_name_online_with_doorsense_name"
).state
== LockState.UNLOCKING
)
@@ -94,7 +104,12 @@ async def test_state_jammed(hass: HomeAssistant) -> None:
activities = await _mock_activities_from_fixture(hass, "get_activity.jammed.json")
await _create_august_with_devices(hass, [lock_one], activities=activities)
assert hass.states.get("lock.online_with_doorsense_name").state == LockState.JAMMED
assert (
hass.states.get(
"lock.online_with_doorsense_name_online_with_doorsense_name"
).state
== LockState.JAMMED
)
async def test_one_lock_operation(
@@ -105,17 +120,23 @@ async def test_one_lock_operation(
await _create_august_with_devices(hass, [lock_one])
states = hass.states
lock_state = states.get("lock.online_with_doorsense_name")
lock_state = states.get(
"lock.online_with_doorsense_name_online_with_doorsense_name"
)
assert lock_state.state == LockState.LOCKED
assert lock_state.attributes["battery_level"] == 92
assert lock_state.attributes["friendly_name"] == "online_with_doorsense Name"
data = {ATTR_ENTITY_ID: "lock.online_with_doorsense_name"}
data = {
ATTR_ENTITY_ID: "lock.online_with_doorsense_name_online_with_doorsense_name"
}
await hass.services.async_call(LOCK_DOMAIN, SERVICE_UNLOCK, data, blocking=True)
lock_state = states.get("lock.online_with_doorsense_name")
lock_state = states.get(
"lock.online_with_doorsense_name_online_with_doorsense_name"
)
assert lock_state.state == LockState.UNLOCKED
assert lock_state.attributes["battery_level"] == 92
@@ -123,15 +144,21 @@ async def test_one_lock_operation(
await hass.services.async_call(LOCK_DOMAIN, SERVICE_LOCK, data, blocking=True)
assert states.get("lock.online_with_doorsense_name").state == LockState.LOCKED
assert (
states.get("lock.online_with_doorsense_name_online_with_doorsense_name").state
== LockState.LOCKED
)
# No activity means it will be unavailable until the activity feed has data
lock_operator_sensor = entity_registry.async_get(
"sensor.online_with_doorsense_name_operator"
"sensor.online_with_doorsense_name_online_with_doorsense_name_operator"
)
assert lock_operator_sensor
assert (
states.get("sensor.online_with_doorsense_name_operator").state == STATE_UNKNOWN
states.get(
"sensor.online_with_doorsense_name_online_with_doorsense_name_operator"
).state
== STATE_UNKNOWN
)
@@ -140,13 +167,17 @@ async def test_open_lock_operation(hass: HomeAssistant) -> None:
lock_with_unlatch = await _mock_lock_with_unlatch(hass)
await _create_august_with_devices(hass, [lock_with_unlatch])
lock_online_with_unlatch_name = hass.states.get("lock.online_with_unlatch_name")
lock_online_with_unlatch_name = hass.states.get(
"lock.online_with_unlatch_name_online_with_unlatch_name"
)
assert lock_online_with_unlatch_name.state == LockState.LOCKED
data = {ATTR_ENTITY_ID: "lock.online_with_unlatch_name"}
data = {ATTR_ENTITY_ID: "lock.online_with_unlatch_name_online_with_unlatch_name"}
await hass.services.async_call(LOCK_DOMAIN, SERVICE_OPEN, data, blocking=True)
lock_online_with_unlatch_name = hass.states.get("lock.online_with_unlatch_name")
lock_online_with_unlatch_name = hass.states.get(
"lock.online_with_unlatch_name_online_with_unlatch_name"
)
assert lock_online_with_unlatch_name.state == LockState.UNLOCKED
@@ -163,9 +194,12 @@ async def test_open_lock_operation_pubnub_connected(
await _create_august_with_devices(hass, [lock_with_unlatch], pubnub=pubnub)
pubnub.connected = True
assert hass.states.get("lock.online_with_unlatch_name").state == LockState.LOCKED
assert (
hass.states.get("lock.online_with_unlatch_name_online_with_unlatch_name").state
== LockState.LOCKED
)
data = {ATTR_ENTITY_ID: "lock.online_with_unlatch_name"}
data = {ATTR_ENTITY_ID: "lock.online_with_unlatch_name_online_with_unlatch_name"}
await hass.services.async_call(LOCK_DOMAIN, SERVICE_OPEN, data, blocking=True)
pubnub.message(
@@ -181,7 +215,10 @@ async def test_open_lock_operation_pubnub_connected(
await hass.async_block_till_done()
await hass.async_block_till_done()
assert hass.states.get("lock.online_with_unlatch_name").state == LockState.UNLOCKED
assert (
hass.states.get("lock.online_with_unlatch_name_online_with_unlatch_name").state
== LockState.UNLOCKED
)
await hass.async_block_till_done()
@@ -198,14 +235,18 @@ async def test_one_lock_operation_pubnub_connected(
await _create_august_with_devices(hass, [lock_one], pubnub=pubnub)
pubnub.connected = True
lock_state = hass.states.get("lock.online_with_doorsense_name")
lock_state = hass.states.get(
"lock.online_with_doorsense_name_online_with_doorsense_name"
)
assert lock_state.state == LockState.LOCKED
assert lock_state.attributes["battery_level"] == 92
assert lock_state.attributes["friendly_name"] == "online_with_doorsense Name"
data = {ATTR_ENTITY_ID: "lock.online_with_doorsense_name"}
data = {
ATTR_ENTITY_ID: "lock.online_with_doorsense_name_online_with_doorsense_name"
}
await hass.services.async_call(LOCK_DOMAIN, SERVICE_UNLOCK, data, blocking=True)
pubnub.message(
@@ -221,7 +262,9 @@ async def test_one_lock_operation_pubnub_connected(
await hass.async_block_till_done()
await hass.async_block_till_done()
lock_state = hass.states.get("lock.online_with_doorsense_name")
lock_state = hass.states.get(
"lock.online_with_doorsense_name_online_with_doorsense_name"
)
assert lock_state.state == LockState.UNLOCKED
assert lock_state.attributes["battery_level"] == 92
@@ -242,16 +285,20 @@ async def test_one_lock_operation_pubnub_connected(
await hass.async_block_till_done()
await hass.async_block_till_done()
lock_state = hass.states.get("lock.online_with_doorsense_name")
lock_state = hass.states.get(
"lock.online_with_doorsense_name_online_with_doorsense_name"
)
assert lock_state.state == LockState.LOCKED
# No activity means it will be unavailable until the activity feed has data
lock_operator_sensor = entity_registry.async_get(
"sensor.online_with_doorsense_name_operator"
"sensor.online_with_doorsense_name_online_with_doorsense_name_operator"
)
assert lock_operator_sensor
assert (
hass.states.get("sensor.online_with_doorsense_name_operator").state
hass.states.get(
"sensor.online_with_doorsense_name_online_with_doorsense_name_operator"
).state
== STATE_UNKNOWN
)
@@ -269,7 +316,9 @@ async def test_one_lock_operation_pubnub_connected(
)
await hass.async_block_till_done()
lock_state = hass.states.get("lock.online_with_doorsense_name")
lock_state = hass.states.get(
"lock.online_with_doorsense_name_online_with_doorsense_name"
)
assert lock_state.state == LockState.UNLOCKED
@@ -288,17 +337,23 @@ async def test_lock_jammed(hass: HomeAssistant) -> None:
},
)
lock_state = hass.states.get("lock.online_with_doorsense_name")
lock_state = hass.states.get(
"lock.online_with_doorsense_name_online_with_doorsense_name"
)
assert lock_state.state == LockState.LOCKED
assert lock_state.attributes["battery_level"] == 92
assert lock_state.attributes["friendly_name"] == "online_with_doorsense Name"
data = {ATTR_ENTITY_ID: "lock.online_with_doorsense_name"}
data = {
ATTR_ENTITY_ID: "lock.online_with_doorsense_name_online_with_doorsense_name"
}
await hass.services.async_call(LOCK_DOMAIN, SERVICE_UNLOCK, data, blocking=True)
lock_state = hass.states.get("lock.online_with_doorsense_name")
lock_state = hass.states.get(
"lock.online_with_doorsense_name_online_with_doorsense_name"
)
assert lock_state.state == LockState.JAMMED
@@ -319,14 +374,18 @@ async def test_lock_throws_exception_on_unknown_status_code(
},
)
lock_state = hass.states.get("lock.online_with_doorsense_name")
lock_state = hass.states.get(
"lock.online_with_doorsense_name_online_with_doorsense_name"
)
assert lock_state.state == LockState.LOCKED
assert lock_state.attributes["battery_level"] == 92
assert lock_state.attributes["friendly_name"] == "online_with_doorsense Name"
data = {ATTR_ENTITY_ID: "lock.online_with_doorsense_name"}
data = {
ATTR_ENTITY_ID: "lock.online_with_doorsense_name_online_with_doorsense_name"
}
with pytest.raises(ClientResponseError):
await hass.services.async_call(LOCK_DOMAIN, SERVICE_UNLOCK, data, blocking=True)
@@ -339,7 +398,7 @@ async def test_one_lock_unknown_state(hass: HomeAssistant) -> None:
)
await _create_august_with_devices(hass, [lock_one])
assert hass.states.get("lock.brokenid_name").state == STATE_UNKNOWN
assert hass.states.get("lock.brokenid_name_brokenid_name").state == STATE_UNKNOWN
async def test_lock_bridge_offline(hass: HomeAssistant) -> None:
@@ -351,7 +410,12 @@ async def test_lock_bridge_offline(hass: HomeAssistant) -> None:
)
await _create_august_with_devices(hass, [lock_one], activities=activities)
assert hass.states.get("lock.online_with_doorsense_name").state == STATE_UNAVAILABLE
assert (
hass.states.get(
"lock.online_with_doorsense_name_online_with_doorsense_name"
).state
== STATE_UNAVAILABLE
)
async def test_lock_bridge_online(hass: HomeAssistant) -> None:
@@ -363,7 +427,12 @@ async def test_lock_bridge_online(hass: HomeAssistant) -> None:
)
await _create_august_with_devices(hass, [lock_one], activities=activities)
assert hass.states.get("lock.online_with_doorsense_name").state == LockState.LOCKED
assert (
hass.states.get(
"lock.online_with_doorsense_name_online_with_doorsense_name"
).state
== LockState.LOCKED
)
async def test_lock_update_via_pubnub(hass: HomeAssistant) -> None:
@@ -379,7 +448,10 @@ async def test_lock_update_via_pubnub(hass: HomeAssistant) -> None:
)
pubnub.connected = True
assert states.get("lock.online_with_doorsense_name").state == LockState.LOCKED
assert (
states.get("lock.online_with_doorsense_name_online_with_doorsense_name").state
== LockState.LOCKED
)
pubnub.message(
pubnub,
@@ -395,7 +467,10 @@ async def test_lock_update_via_pubnub(hass: HomeAssistant) -> None:
await hass.async_block_till_done()
await hass.async_block_till_done()
assert states.get("lock.online_with_doorsense_name").state == LockState.UNLOCKING
assert (
states.get("lock.online_with_doorsense_name_online_with_doorsense_name").state
== LockState.UNLOCKING
)
pubnub.message(
pubnub,
@@ -411,21 +486,35 @@ async def test_lock_update_via_pubnub(hass: HomeAssistant) -> None:
await hass.async_block_till_done()
await hass.async_block_till_done()
assert states.get("lock.online_with_doorsense_name").state == LockState.LOCKING
assert (
states.get("lock.online_with_doorsense_name_online_with_doorsense_name").state
== LockState.LOCKING
)
async_fire_time_changed(hass, dt_util.utcnow() + datetime.timedelta(seconds=30))
await hass.async_block_till_done()
assert hass.states.get("lock.online_with_doorsense_name").state == LockState.LOCKING
assert (
hass.states.get(
"lock.online_with_doorsense_name_online_with_doorsense_name"
).state
== LockState.LOCKING
)
pubnub.connected = True
async_fire_time_changed(hass, dt_util.utcnow() + datetime.timedelta(seconds=30))
await hass.async_block_till_done()
assert states.get("lock.online_with_doorsense_name").state == LockState.LOCKING
assert (
states.get("lock.online_with_doorsense_name_online_with_doorsense_name").state
== LockState.LOCKING
)
# Ensure pubnub status is always preserved
async_fire_time_changed(hass, dt_util.utcnow() + datetime.timedelta(hours=2))
await hass.async_block_till_done()
assert states.get("lock.online_with_doorsense_name").state == LockState.LOCKING
assert (
states.get("lock.online_with_doorsense_name_online_with_doorsense_name").state
== LockState.LOCKING
)
pubnub.message(
pubnub,
@@ -440,11 +529,17 @@ async def test_lock_update_via_pubnub(hass: HomeAssistant) -> None:
await hass.async_block_till_done()
await hass.async_block_till_done()
assert states.get("lock.online_with_doorsense_name").state == LockState.UNLOCKING
assert (
states.get("lock.online_with_doorsense_name_online_with_doorsense_name").state
== LockState.UNLOCKING
)
async_fire_time_changed(hass, dt_util.utcnow() + datetime.timedelta(hours=4))
await hass.async_block_till_done()
assert states.get("lock.online_with_doorsense_name").state == LockState.UNLOCKING
assert (
states.get("lock.online_with_doorsense_name_online_with_doorsense_name").state
== LockState.UNLOCKING
)
await hass.config_entries.async_unload(config_entry.entry_id)
await hass.async_block_till_done()
@@ -457,6 +552,8 @@ async def test_open_throws_hass_service_not_supported_error(
await async_setup_component(hass, "homeassistant", {})
mocked_lock_detail = await _mock_operative_august_lock_detail(hass)
await _create_august_with_devices(hass, [mocked_lock_detail])
data = {ATTR_ENTITY_ID: "lock.a6697750d607098bae8d6baa11ef8063_name"}
data = {
ATTR_ENTITY_ID: "lock.a6697750d607098bae8d6baa11ef8063_name_a6697750d607098bae8d6baa11ef8063_name"
}
with pytest.raises(ServiceNotSupported, match="does not support action"):
await hass.services.async_call(LOCK_DOMAIN, SERVICE_OPEN, data, blocking=True)
+51 -29
View File
@@ -28,7 +28,9 @@ async def test_create_doorbell(hass: HomeAssistant) -> None:
doorbell_one = await _mock_doorbell_from_fixture(hass, "get_doorbell.json")
await _create_august_with_devices(hass, [doorbell_one])
battery_state = hass.states.get("sensor.k98gidt45gul_name_battery")
battery_state = hass.states.get(
"sensor.k98gidt45gul_name_k98gidt45gul_name_battery"
)
assert battery_state.state == "96"
assert battery_state.attributes["unit_of_measurement"] == PERCENTAGE
@@ -40,11 +42,11 @@ async def test_create_doorbell_offline(
doorbell_one = await _mock_doorbell_from_fixture(hass, "get_doorbell.offline.json")
await _create_august_with_devices(hass, [doorbell_one])
battery_state = hass.states.get("sensor.tmt100_name_battery")
battery_state = hass.states.get("sensor.tmt100_name_tmt100_name_battery")
assert battery_state.state == "81"
assert battery_state.attributes["unit_of_measurement"] == PERCENTAGE
entry = entity_registry.async_get("sensor.tmt100_name_battery")
entry = entity_registry.async_get("sensor.tmt100_name_tmt100_name_battery")
assert entry
assert entry.unique_id == "tmt100_device_battery"
@@ -56,7 +58,7 @@ async def test_create_doorbell_hardwired(hass: HomeAssistant) -> None:
)
await _create_august_with_devices(hass, [doorbell_one])
assert hass.states.get("sensor.tmt100_name_battery") is None
assert hass.states.get("sensor.tmt100_name_tmt100_name_battery") is None
async def test_create_lock_with_linked_keypad(
@@ -67,21 +69,23 @@ async def test_create_lock_with_linked_keypad(
await _create_august_with_devices(hass, [lock_one])
battery_state = hass.states.get(
"sensor.a6697750d607098bae8d6baa11ef8063_name_battery"
"sensor.a6697750d607098bae8d6baa11ef8063_name_a6697750d607098bae8d6baa11ef8063_name_battery"
)
assert battery_state.state == "88"
assert battery_state.attributes["unit_of_measurement"] == PERCENTAGE
entry = entity_registry.async_get(
"sensor.a6697750d607098bae8d6baa11ef8063_name_battery"
"sensor.a6697750d607098bae8d6baa11ef8063_name_a6697750d607098bae8d6baa11ef8063_name_battery"
)
assert entry
assert entry.unique_id == "A6697750D607098BAE8D6BAA11EF8063_device_battery"
keypad_battery_state = hass.states.get("sensor.front_door_lock_keypad_battery")
keypad_battery_state = hass.states.get(
"sensor.front_front_door_lock_keypad_battery"
)
assert keypad_battery_state.state == "62"
assert keypad_battery_state.attributes[ATTR_UNIT_OF_MEASUREMENT] == PERCENTAGE
entry = entity_registry.async_get("sensor.front_door_lock_keypad_battery")
entry = entity_registry.async_get("sensor.front_front_door_lock_keypad_battery")
assert entry
assert entry.unique_id == "5bc65c24e6ef2a263e1450a8_linked_keypad_battery"
@@ -94,29 +98,33 @@ async def test_create_lock_with_low_battery_linked_keypad(
await _create_august_with_devices(hass, [lock_one])
states = hass.states
battery_state = states.get("sensor.a6697750d607098bae8d6baa11ef8063_name_battery")
battery_state = states.get(
"sensor.a6697750d607098bae8d6baa11ef8063_name_a6697750d607098bae8d6baa11ef8063_name_battery"
)
assert battery_state.state == "88"
assert battery_state.attributes["unit_of_measurement"] == PERCENTAGE
entry = entity_registry.async_get(
"sensor.a6697750d607098bae8d6baa11ef8063_name_battery"
"sensor.a6697750d607098bae8d6baa11ef8063_name_a6697750d607098bae8d6baa11ef8063_name_battery"
)
assert entry
assert entry.unique_id == "A6697750D607098BAE8D6BAA11EF8063_device_battery"
keypad_battery_state = states.get("sensor.front_door_lock_keypad_battery")
keypad_battery_state = states.get("sensor.front_front_door_lock_keypad_battery")
assert keypad_battery_state.state == "10"
assert keypad_battery_state.attributes[ATTR_UNIT_OF_MEASUREMENT] == PERCENTAGE
entry = entity_registry.async_get("sensor.front_door_lock_keypad_battery")
entry = entity_registry.async_get("sensor.front_front_door_lock_keypad_battery")
assert entry
assert entry.unique_id == "5bc65c24e6ef2a263e1450a8_linked_keypad_battery"
# No activity means it will be unavailable until someone unlocks/locks it
operator_entry = entity_registry.async_get(
"sensor.a6697750d607098bae8d6baa11ef8063_name_operator"
"sensor.a6697750d607098bae8d6baa11ef8063_name_a6697750d607098bae8d6baa11ef8063_name_operator"
)
assert operator_entry.unique_id == "A6697750D607098BAE8D6BAA11EF8063_lock_operator"
operator_state = states.get("sensor.a6697750d607098bae8d6baa11ef8063_name_operator")
operator_state = states.get(
"sensor.a6697750d607098bae8d6baa11ef8063_name_a6697750d607098bae8d6baa11ef8063_name_operator"
)
assert operator_state.state == STATE_UNKNOWN
@@ -132,11 +140,13 @@ async def test_lock_operator_bluetooth(
await _create_august_with_devices(hass, [lock_one], activities=activities)
lock_operator_sensor = entity_registry.async_get(
"sensor.online_with_doorsense_name_operator"
"sensor.online_with_doorsense_name_online_with_doorsense_name_operator"
)
assert lock_operator_sensor
state = hass.states.get("sensor.online_with_doorsense_name_operator")
state = hass.states.get(
"sensor.online_with_doorsense_name_online_with_doorsense_name_operator"
)
assert state.state == "Your favorite elven princess"
assert state.attributes["manual"] is False
assert state.attributes["tag"] is False
@@ -158,11 +168,13 @@ async def test_lock_operator_keypad(
await _create_august_with_devices(hass, [lock_one], activities=activities)
lock_operator_sensor = entity_registry.async_get(
"sensor.online_with_doorsense_name_operator"
"sensor.online_with_doorsense_name_online_with_doorsense_name_operator"
)
assert lock_operator_sensor
state = hass.states.get("sensor.online_with_doorsense_name_operator")
state = hass.states.get(
"sensor.online_with_doorsense_name_online_with_doorsense_name_operator"
)
assert state.state == "Your favorite elven princess"
assert state.attributes["manual"] is False
assert state.attributes["tag"] is False
@@ -182,11 +194,13 @@ async def test_lock_operator_remote(
await _create_august_with_devices(hass, [lock_one], activities=activities)
lock_operator_sensor = entity_registry.async_get(
"sensor.online_with_doorsense_name_operator"
"sensor.online_with_doorsense_name_online_with_doorsense_name_operator"
)
assert lock_operator_sensor
state = hass.states.get("sensor.online_with_doorsense_name_operator")
state = hass.states.get(
"sensor.online_with_doorsense_name_online_with_doorsense_name_operator"
)
assert state.state == "Your favorite elven princess"
assert state.attributes["manual"] is False
assert state.attributes["tag"] is False
@@ -208,10 +222,12 @@ async def test_lock_operator_manual(
await _create_august_with_devices(hass, [lock_one], activities=activities)
lock_operator_sensor = entity_registry.async_get(
"sensor.online_with_doorsense_name_operator"
"sensor.online_with_doorsense_name_online_with_doorsense_name_operator"
)
assert lock_operator_sensor
state = hass.states.get("sensor.online_with_doorsense_name_operator")
state = hass.states.get(
"sensor.online_with_doorsense_name_online_with_doorsense_name_operator"
)
assert state.state == "Your favorite elven princess"
assert state.attributes["manual"] is True
assert state.attributes["tag"] is False
@@ -233,11 +249,13 @@ async def test_lock_operator_autorelock(
await _create_august_with_devices(hass, [lock_one], activities=activities)
lock_operator_sensor = entity_registry.async_get(
"sensor.online_with_doorsense_name_operator"
"sensor.online_with_doorsense_name_online_with_doorsense_name_operator"
)
assert lock_operator_sensor
state = hass.states.get("sensor.online_with_doorsense_name_operator")
state = hass.states.get(
"sensor.online_with_doorsense_name_online_with_doorsense_name_operator"
)
assert state.state == "Auto Relock"
assert state.attributes["manual"] is False
assert state.attributes["tag"] is False
@@ -259,11 +277,13 @@ async def test_unlock_operator_manual(
await _create_august_with_devices(hass, [lock_one], activities=activities)
lock_operator_sensor = entity_registry.async_get(
"sensor.online_with_doorsense_name_operator"
"sensor.online_with_doorsense_name_online_with_doorsense_name_operator"
)
assert lock_operator_sensor
state = hass.states.get("sensor.online_with_doorsense_name_operator")
state = hass.states.get(
"sensor.online_with_doorsense_name_online_with_doorsense_name_operator"
)
assert state.state == "Your favorite elven princess"
assert state.attributes["manual"] is True
assert state.attributes["tag"] is False
@@ -285,11 +305,13 @@ async def test_unlock_operator_tag(
await _create_august_with_devices(hass, [lock_one], activities=activities)
lock_operator_sensor = entity_registry.async_get(
"sensor.online_with_doorsense_name_operator"
"sensor.online_with_doorsense_name_online_with_doorsense_name_operator"
)
assert lock_operator_sensor
state = hass.states.get("sensor.online_with_doorsense_name_operator")
state = hass.states.get(
"sensor.online_with_doorsense_name_online_with_doorsense_name_operator"
)
assert state.state == "Your favorite elven princess"
assert state.attributes["manual"] is False
assert state.attributes["tag"] is True
@@ -304,7 +326,7 @@ async def test_restored_state(
) -> None:
"""Test restored state."""
entity_id = "sensor.online_with_doorsense_name_operator"
entity_id = "sensor.online_with_doorsense_name_online_with_doorsense_name_operator"
lock_one = await _mock_doorsense_enabled_august_lock_detail(hass)
fake_state = ha.State(
+1 -1
View File
@@ -20,7 +20,7 @@ async def test_climate_set_temperature_calls_library(
assert await hass.config_entries.async_setup(mock_config_entry.entry_id)
await hass.async_block_till_done()
entity_id = "climate.living_room"
entity_id = "climate.living_room_living_room"
await hass.services.async_call(
"climate",
+12 -12
View File
@@ -1,5 +1,5 @@
# serializer version: 1
# name: test_entities[light.bedroom_lamp-entry]
# name: test_entities[light.bedroom_bedroom_lamp-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
@@ -20,7 +20,7 @@
'disabled_by': None,
'domain': 'light',
'entity_category': None,
'entity_id': 'light.bedroom_lamp',
'entity_id': 'light.bedroom_bedroom_lamp',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -43,7 +43,7 @@
'unit_of_measurement': None,
})
# ---
# name: test_entities[light.bedroom_lamp-state]
# name: test_entities[light.bedroom_bedroom_lamp-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'brightness': 205,
@@ -72,14 +72,14 @@
),
}),
'context': <ANY>,
'entity_id': 'light.bedroom_lamp',
'entity_id': 'light.bedroom_bedroom_lamp',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'on',
})
# ---
# name: test_entities[light.lamp_bulb_1-entry]
# name: test_entities[light.office_lamp_bulb_1-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
@@ -100,7 +100,7 @@
'disabled_by': None,
'domain': 'light',
'entity_category': None,
'entity_id': 'light.lamp_bulb_1',
'entity_id': 'light.office_lamp_bulb_1',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -123,7 +123,7 @@
'unit_of_measurement': None,
})
# ---
# name: test_entities[light.lamp_bulb_1-state]
# name: test_entities[light.office_lamp_bulb_1-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'brightness': None,
@@ -142,14 +142,14 @@
'xy_color': None,
}),
'context': <ANY>,
'entity_id': 'light.lamp_bulb_1',
'entity_id': 'light.office_lamp_bulb_1',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'off',
})
# ---
# name: test_entities[light.lamp_bulb_2-entry]
# name: test_entities[light.office_lamp_bulb_2-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
@@ -170,7 +170,7 @@
'disabled_by': None,
'domain': 'light',
'entity_category': None,
'entity_id': 'light.lamp_bulb_2',
'entity_id': 'light.office_lamp_bulb_2',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -193,7 +193,7 @@
'unit_of_measurement': None,
})
# ---
# name: test_entities[light.lamp_bulb_2-state]
# name: test_entities[light.office_lamp_bulb_2-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'friendly_name': 'Lamp Bulb 2',
@@ -206,7 +206,7 @@
'supported_features': <LightEntityFeature: 0>,
}),
'context': <ANY>,
'entity_id': 'light.lamp_bulb_2',
'entity_id': 'light.office_lamp_bulb_2',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
+2 -2
View File
@@ -52,9 +52,9 @@ async def test_turn_on(
await setup_integration(hass, mock_config_entry)
assert hass.states.get("light.lamp_bulb_1").state == "off"
assert hass.states.get("light.office_lamp_bulb_1").state == "off"
entity_id_parameter = {"entity_id": "light.lamp_bulb_1"}
entity_id_parameter = {"entity_id": "light.office_lamp_bulb_1"}
action_parameters = entity_id_parameter | input_parameters
test_device = mock_config_entry.runtime_data.data.get(1111)
@@ -6,7 +6,7 @@
'friendly_name': 'Test Door',
}),
'context': <ANY>,
'entity_id': 'binary_sensor.test_door',
'entity_id': 'binary_sensor.test_test_door',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
@@ -27,7 +27,7 @@
'disabled_by': None,
'domain': 'binary_sensor',
'entity_category': None,
'entity_id': 'binary_sensor.test_door',
'entity_id': 'binary_sensor.test_test_door',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -57,7 +57,7 @@
'friendly_name': 'Test Overload',
}),
'context': <ANY>,
'entity_id': 'binary_sensor.test_overload',
'entity_id': 'binary_sensor.test_test_overload',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
@@ -78,7 +78,7 @@
'disabled_by': None,
'domain': 'binary_sensor',
'entity_category': <EntityCategory.DIAGNOSTIC: 'diagnostic'>,
'entity_id': 'binary_sensor.test_overload',
'entity_id': 'binary_sensor.test_test_overload',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -107,7 +107,7 @@
'friendly_name': 'Test Button 1',
}),
'context': <ANY>,
'entity_id': 'binary_sensor.test_button_1',
'entity_id': 'binary_sensor.test_test_button_1',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
@@ -128,7 +128,7 @@
'disabled_by': None,
'domain': 'binary_sensor',
'entity_category': None,
'entity_id': 'binary_sensor.test_button_1',
'entity_id': 'binary_sensor.test_test_button_1',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -14,7 +14,7 @@
'temperature': 20,
}),
'context': <ANY>,
'entity_id': 'climate.test',
'entity_id': 'climate.test_test',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
@@ -42,7 +42,7 @@
'disabled_by': None,
'domain': 'climate',
'entity_category': None,
'entity_id': 'climate.test',
'entity_id': 'climate.test_test',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -9,7 +9,7 @@
'supported_features': <CoverEntityFeature: 7>,
}),
'context': <ANY>,
'entity_id': 'cover.test',
'entity_id': 'cover.test_test',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
@@ -30,7 +30,7 @@
'disabled_by': None,
'domain': 'cover',
'entity_category': None,
'entity_id': 'cover.test',
'entity_id': 'cover.test_test',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -11,7 +11,7 @@
'supported_features': <LightEntityFeature: 0>,
}),
'context': <ANY>,
'entity_id': 'light.test',
'entity_id': 'light.test_test',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
@@ -36,7 +36,7 @@
'disabled_by': None,
'domain': 'light',
'entity_category': None,
'entity_id': 'light.test',
'entity_id': 'light.test_test',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -71,7 +71,7 @@
'supported_features': <LightEntityFeature: 0>,
}),
'context': <ANY>,
'entity_id': 'light.test',
'entity_id': 'light.test_test',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
@@ -96,7 +96,7 @@
'disabled_by': None,
'domain': 'light',
'entity_category': None,
'entity_id': 'light.test',
'entity_id': 'light.test_test',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -8,7 +8,7 @@
'unit_of_measurement': '%',
}),
'context': <ANY>,
'entity_id': 'sensor.test_battery',
'entity_id': 'sensor.test_test_battery',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
@@ -31,7 +31,7 @@
'disabled_by': None,
'domain': 'sensor',
'entity_category': <EntityCategory.DIAGNOSTIC: 'diagnostic'>,
'entity_id': 'sensor.test_battery',
'entity_id': 'sensor.test_test_battery',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -62,7 +62,7 @@
'unit_of_measurement': '%',
}),
'context': <ANY>,
'entity_id': 'sensor.test_brightness',
'entity_id': 'sensor.test_test_brightness',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
@@ -85,7 +85,7 @@
'disabled_by': None,
'domain': 'sensor',
'entity_category': None,
'entity_id': 'sensor.test_brightness',
'entity_id': 'sensor.test_test_brightness',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -117,7 +117,7 @@
'unit_of_measurement': 'W',
}),
'context': <ANY>,
'entity_id': 'sensor.test_power',
'entity_id': 'sensor.test_test_power',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
@@ -140,7 +140,7 @@
'disabled_by': None,
'domain': 'sensor',
'entity_category': None,
'entity_id': 'sensor.test_power',
'entity_id': 'sensor.test_test_power',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -175,7 +175,7 @@
'unit_of_measurement': 'kWh',
}),
'context': <ANY>,
'entity_id': 'sensor.test_energy',
'entity_id': 'sensor.test_test_energy',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
@@ -198,7 +198,7 @@
'disabled_by': None,
'domain': 'sensor',
'entity_category': None,
'entity_id': 'sensor.test_energy',
'entity_id': 'sensor.test_test_energy',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -233,7 +233,7 @@
'unit_of_measurement': <UnitOfTemperature.CELSIUS: '°C'>,
}),
'context': <ANY>,
'entity_id': 'sensor.test_temperature',
'entity_id': 'sensor.test_test_temperature',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
@@ -256,7 +256,7 @@
'disabled_by': None,
'domain': 'sensor',
'entity_category': None,
'entity_id': 'sensor.test_temperature',
'entity_id': 'sensor.test_test_temperature',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -9,7 +9,7 @@
'supported_features': <SirenEntityFeature: 7>,
}),
'context': <ANY>,
'entity_id': 'siren.test',
'entity_id': 'siren.test_test',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
@@ -34,7 +34,7 @@
'disabled_by': None,
'domain': 'siren',
'entity_category': None,
'entity_id': 'siren.test',
'entity_id': 'siren.test_test',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -67,7 +67,7 @@
'supported_features': <SirenEntityFeature: 7>,
}),
'context': <ANY>,
'entity_id': 'siren.test',
'entity_id': 'siren.test_test',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
@@ -92,7 +92,7 @@
'disabled_by': None,
'domain': 'siren',
'entity_category': None,
'entity_id': 'siren.test',
'entity_id': 'siren.test_test',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -125,7 +125,7 @@
'supported_features': <SirenEntityFeature: 7>,
}),
'context': <ANY>,
'entity_id': 'siren.test',
'entity_id': 'siren.test_test',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
@@ -150,7 +150,7 @@
'disabled_by': None,
'domain': 'siren',
'entity_category': None,
'entity_id': 'siren.test',
'entity_id': 'siren.test_test',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -5,7 +5,7 @@
'friendly_name': 'Test',
}),
'context': <ANY>,
'entity_id': 'switch.test',
'entity_id': 'switch.test_test',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
@@ -26,7 +26,7 @@
'disabled_by': None,
'domain': 'switch',
'entity_category': None,
'entity_id': 'switch.test',
'entity_id': 'switch.test_test',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -36,27 +36,31 @@ async def test_binary_sensor(
await hass.config_entries.async_setup(entry.entry_id)
await hass.async_block_till_done()
state = hass.states.get(f"{BINARY_SENSOR_DOMAIN}.test_door")
assert state == snapshot
assert entity_registry.async_get(f"{BINARY_SENSOR_DOMAIN}.test_door") == snapshot
state = hass.states.get(f"{BINARY_SENSOR_DOMAIN}.test_overload")
state = hass.states.get(f"{BINARY_SENSOR_DOMAIN}.test_test_door")
assert state == snapshot
assert (
entity_registry.async_get(f"{BINARY_SENSOR_DOMAIN}.test_overload") == snapshot
entity_registry.async_get(f"{BINARY_SENSOR_DOMAIN}.test_test_door") == snapshot
)
state = hass.states.get(f"{BINARY_SENSOR_DOMAIN}.test_test_overload")
assert state == snapshot
assert (
entity_registry.async_get(f"{BINARY_SENSOR_DOMAIN}.test_test_overload")
== snapshot
)
# Emulate websocket message: sensor turned on
test_gateway.publisher.dispatch("Test", ("Test", True))
await hass.async_block_till_done()
assert hass.states.get(f"{BINARY_SENSOR_DOMAIN}.test_door").state == STATE_ON
assert hass.states.get(f"{BINARY_SENSOR_DOMAIN}.test_test_door").state == STATE_ON
# Emulate websocket message: device went offline
test_gateway.devices["Test"].status = 1
test_gateway.publisher.dispatch("Test", ("Status", False, "status"))
await hass.async_block_till_done()
assert (
hass.states.get(f"{BINARY_SENSOR_DOMAIN}.test_door").state == STATE_UNAVAILABLE
hass.states.get(f"{BINARY_SENSOR_DOMAIN}.test_test_door").state
== STATE_UNAVAILABLE
)
# Emulate websocket message: device was deleted
@@ -80,28 +84,33 @@ async def test_remote_control(
await hass.config_entries.async_setup(entry.entry_id)
await hass.async_block_till_done()
state = hass.states.get(f"{BINARY_SENSOR_DOMAIN}.test_button_1")
state = hass.states.get(f"{BINARY_SENSOR_DOMAIN}.test_test_button_1")
assert state == snapshot
assert (
entity_registry.async_get(f"{BINARY_SENSOR_DOMAIN}.test_button_1") == snapshot
entity_registry.async_get(f"{BINARY_SENSOR_DOMAIN}.test_test_button_1")
== snapshot
)
# Emulate websocket message: button pressed
test_gateway.publisher.dispatch("Test", ("Test", 1))
await hass.async_block_till_done()
assert hass.states.get(f"{BINARY_SENSOR_DOMAIN}.test_button_1").state == STATE_ON
assert (
hass.states.get(f"{BINARY_SENSOR_DOMAIN}.test_test_button_1").state == STATE_ON
)
# Emulate websocket message: button released
test_gateway.publisher.dispatch("Test", ("Test", 0))
await hass.async_block_till_done()
assert hass.states.get(f"{BINARY_SENSOR_DOMAIN}.test_button_1").state == STATE_OFF
assert (
hass.states.get(f"{BINARY_SENSOR_DOMAIN}.test_test_button_1").state == STATE_OFF
)
# Emulate websocket message: device went offline
test_gateway.devices["Test"].status = 1
test_gateway.publisher.dispatch("Test", ("Status", False, "status"))
await hass.async_block_till_done()
assert (
hass.states.get(f"{BINARY_SENSOR_DOMAIN}.test_button_1").state
hass.states.get(f"{BINARY_SENSOR_DOMAIN}.test_test_button_1").state
== STATE_UNAVAILABLE
)
@@ -116,7 +125,7 @@ async def test_disabled(hass: HomeAssistant) -> None:
await hass.config_entries.async_setup(entry.entry_id)
await hass.async_block_till_done()
assert hass.states.get(f"{BINARY_SENSOR_DOMAIN}.test_door") is None
assert hass.states.get(f"{BINARY_SENSOR_DOMAIN}.test_test_door") is None
async def test_remove_from_hass(hass: HomeAssistant) -> None:
@@ -130,7 +139,7 @@ async def test_remove_from_hass(hass: HomeAssistant) -> None:
await hass.config_entries.async_setup(entry.entry_id)
await hass.async_block_till_done()
state = hass.states.get(f"{BINARY_SENSOR_DOMAIN}.test_door")
state = hass.states.get(f"{BINARY_SENSOR_DOMAIN}.test_test_door")
assert state is not None
await hass.config_entries.async_remove(entry.entry_id)
await hass.async_block_till_done()
@@ -32,14 +32,14 @@ async def test_climate(
await hass.config_entries.async_setup(entry.entry_id)
await hass.async_block_till_done()
state = hass.states.get(f"{CLIMATE_DOMAIN}.test")
state = hass.states.get(f"{CLIMATE_DOMAIN}.test_test")
assert state == snapshot
assert entity_registry.async_get(f"{CLIMATE_DOMAIN}.test") == snapshot
assert entity_registry.async_get(f"{CLIMATE_DOMAIN}.test_test") == snapshot
# Emulate websocket message: temperature changed
test_gateway.publisher.dispatch("Test", ("Test", 21.0))
await hass.async_block_till_done()
state = hass.states.get(f"{CLIMATE_DOMAIN}.test")
state = hass.states.get(f"{CLIMATE_DOMAIN}.test_test")
assert state.state == HVACMode.HEAT
assert state.attributes[ATTR_TEMPERATURE] == 21.0
@@ -51,7 +51,7 @@ async def test_climate(
CLIMATE_DOMAIN,
SERVICE_SET_TEMPERATURE,
{
ATTR_ENTITY_ID: f"{CLIMATE_DOMAIN}.test",
ATTR_ENTITY_ID: f"{CLIMATE_DOMAIN}.test_test",
ATTR_HVAC_MODE: HVACMode.HEAT,
ATTR_TEMPERATURE: 20.0,
},
@@ -63,7 +63,7 @@ async def test_climate(
test_gateway.devices["Test"].status = 1
test_gateway.publisher.dispatch("Test", ("Status", False, "status"))
await hass.async_block_till_done()
assert hass.states.get(f"{CLIMATE_DOMAIN}.test").state == STATE_UNAVAILABLE
assert hass.states.get(f"{CLIMATE_DOMAIN}.test_test").state == STATE_UNAVAILABLE
async def test_remove_from_hass(hass: HomeAssistant) -> None:
@@ -77,7 +77,7 @@ async def test_remove_from_hass(hass: HomeAssistant) -> None:
await hass.config_entries.async_setup(entry.entry_id)
await hass.async_block_till_done()
state = hass.states.get(f"{CLIMATE_DOMAIN}.test")
state = hass.states.get(f"{CLIMATE_DOMAIN}.test_test")
assert state is not None
await hass.config_entries.async_remove(entry.entry_id)
await hass.async_block_till_done()
@@ -38,14 +38,14 @@ async def test_cover(
await hass.config_entries.async_setup(entry.entry_id)
await hass.async_block_till_done()
state = hass.states.get(f"{COVER_DOMAIN}.test")
state = hass.states.get(f"{COVER_DOMAIN}.test_test")
assert state == snapshot
assert entity_registry.async_get(f"{COVER_DOMAIN}.test") == snapshot
assert entity_registry.async_get(f"{COVER_DOMAIN}.test_test") == snapshot
# Emulate websocket message: position changed
test_gateway.publisher.dispatch("Test", ("devolo.Blinds", 0.0))
await hass.async_block_till_done()
state = hass.states.get(f"{COVER_DOMAIN}.test")
state = hass.states.get(f"{COVER_DOMAIN}.test_test")
assert state.state == CoverState.CLOSED
assert state.attributes[ATTR_CURRENT_POSITION] == 0.0
@@ -56,7 +56,7 @@ async def test_cover(
await hass.services.async_call(
COVER_DOMAIN,
SERVICE_OPEN_COVER,
{ATTR_ENTITY_ID: f"{COVER_DOMAIN}.test"},
{ATTR_ENTITY_ID: f"{COVER_DOMAIN}.test_test"},
blocking=True,
) # In reality, this leads to a websocket message like already tested above
set_value.assert_called_once_with(100)
@@ -65,7 +65,7 @@ async def test_cover(
await hass.services.async_call(
COVER_DOMAIN,
SERVICE_CLOSE_COVER,
{ATTR_ENTITY_ID: f"{COVER_DOMAIN}.test"},
{ATTR_ENTITY_ID: f"{COVER_DOMAIN}.test_test"},
blocking=True,
) # In reality, this leads to a websocket message like already tested above
set_value.assert_called_once_with(0)
@@ -74,7 +74,7 @@ async def test_cover(
await hass.services.async_call(
COVER_DOMAIN,
SERVICE_SET_COVER_POSITION,
{ATTR_ENTITY_ID: f"{COVER_DOMAIN}.test", ATTR_POSITION: 50},
{ATTR_ENTITY_ID: f"{COVER_DOMAIN}.test_test", ATTR_POSITION: 50},
blocking=True,
) # In reality, this leads to a websocket message like already tested above
set_value.assert_called_once_with(50)
@@ -83,7 +83,7 @@ async def test_cover(
test_gateway.devices["Test"].status = 1
test_gateway.publisher.dispatch("Test", ("Status", False, "status"))
await hass.async_block_till_done()
assert hass.states.get(f"{COVER_DOMAIN}.test").state == STATE_UNAVAILABLE
assert hass.states.get(f"{COVER_DOMAIN}.test_test").state == STATE_UNAVAILABLE
async def test_remove_from_hass(hass: HomeAssistant) -> None:
@@ -97,7 +97,7 @@ async def test_remove_from_hass(hass: HomeAssistant) -> None:
await hass.config_entries.async_setup(entry.entry_id)
await hass.async_block_till_done()
state = hass.states.get(f"{COVER_DOMAIN}.test")
state = hass.states.get(f"{COVER_DOMAIN}.test_test")
assert state is not None
await hass.config_entries.async_remove(entry.entry_id)
await hass.async_block_till_done()
@@ -33,18 +33,18 @@ async def test_light_without_binary_sensor(
await hass.config_entries.async_setup(entry.entry_id)
await hass.async_block_till_done()
state = hass.states.get(f"{LIGHT_DOMAIN}.test")
state = hass.states.get(f"{LIGHT_DOMAIN}.test_test")
assert state == snapshot
assert entity_registry.async_get(f"{LIGHT_DOMAIN}.test") == snapshot
assert entity_registry.async_get(f"{LIGHT_DOMAIN}.test_test") == snapshot
# Emulate websocket message: brightness changed
test_gateway.publisher.dispatch("Test", ("devolo.Dimmer:Test", 0.0))
await hass.async_block_till_done()
state = hass.states.get(f"{LIGHT_DOMAIN}.test")
state = hass.states.get(f"{LIGHT_DOMAIN}.test_test")
assert state.state == STATE_OFF
test_gateway.publisher.dispatch("Test", ("devolo.Dimmer:Test", 100.0))
await hass.async_block_till_done()
state = hass.states.get(f"{LIGHT_DOMAIN}.test")
state = hass.states.get(f"{LIGHT_DOMAIN}.test_test")
assert state.state == STATE_ON
assert state.attributes[ATTR_BRIGHTNESS] == 255
@@ -55,7 +55,7 @@ async def test_light_without_binary_sensor(
await hass.services.async_call(
LIGHT_DOMAIN,
SERVICE_TURN_ON,
{ATTR_ENTITY_ID: f"{LIGHT_DOMAIN}.test"},
{ATTR_ENTITY_ID: f"{LIGHT_DOMAIN}.test_test"},
blocking=True,
) # In reality, this leads to a websocket message like already tested above
set_value.assert_called_once_with(100)
@@ -64,7 +64,7 @@ async def test_light_without_binary_sensor(
await hass.services.async_call(
LIGHT_DOMAIN,
SERVICE_TURN_OFF,
{ATTR_ENTITY_ID: f"{LIGHT_DOMAIN}.test"},
{ATTR_ENTITY_ID: f"{LIGHT_DOMAIN}.test_test"},
blocking=True,
) # In reality, this leads to a websocket message like already tested above
set_value.assert_called_once_with(0)
@@ -73,7 +73,7 @@ async def test_light_without_binary_sensor(
await hass.services.async_call(
LIGHT_DOMAIN,
SERVICE_TURN_ON,
{ATTR_ENTITY_ID: f"{LIGHT_DOMAIN}.test", ATTR_BRIGHTNESS: 50},
{ATTR_ENTITY_ID: f"{LIGHT_DOMAIN}.test_test", ATTR_BRIGHTNESS: 50},
blocking=True,
) # In reality, this leads to a websocket message like already tested above
set_value.assert_called_once_with(round(50 / 255 * 100))
@@ -82,7 +82,7 @@ async def test_light_without_binary_sensor(
test_gateway.devices["Test"].status = 1
test_gateway.publisher.dispatch("Test", ("Status", False, "status"))
await hass.async_block_till_done()
assert hass.states.get(f"{LIGHT_DOMAIN}.test").state == STATE_UNAVAILABLE
assert hass.states.get(f"{LIGHT_DOMAIN}.test_test").state == STATE_UNAVAILABLE
async def test_light_with_binary_sensor(
@@ -101,18 +101,18 @@ async def test_light_with_binary_sensor(
await hass.config_entries.async_setup(entry.entry_id)
await hass.async_block_till_done()
state = hass.states.get(f"{LIGHT_DOMAIN}.test")
state = hass.states.get(f"{LIGHT_DOMAIN}.test_test")
assert state == snapshot
assert entity_registry.async_get(f"{LIGHT_DOMAIN}.test") == snapshot
assert entity_registry.async_get(f"{LIGHT_DOMAIN}.test_test") == snapshot
# Emulate websocket message: brightness changed
test_gateway.publisher.dispatch("Test", ("devolo.Dimmer:Test", 0.0))
await hass.async_block_till_done()
state = hass.states.get(f"{LIGHT_DOMAIN}.test")
state = hass.states.get(f"{LIGHT_DOMAIN}.test_test")
assert state.state == STATE_OFF
test_gateway.publisher.dispatch("Test", ("devolo.Dimmer:Test", 100.0))
await hass.async_block_till_done()
state = hass.states.get(f"{LIGHT_DOMAIN}.test")
state = hass.states.get(f"{LIGHT_DOMAIN}.test_test")
assert state.state == STATE_ON
assert state.attributes[ATTR_BRIGHTNESS] == 255
@@ -123,7 +123,7 @@ async def test_light_with_binary_sensor(
await hass.services.async_call(
LIGHT_DOMAIN,
SERVICE_TURN_ON,
{ATTR_ENTITY_ID: f"{LIGHT_DOMAIN}.test"},
{ATTR_ENTITY_ID: f"{LIGHT_DOMAIN}.test_test"},
blocking=True,
) # In reality, this leads to a websocket message like already tested above
set_value.assert_called_once_with(True)
@@ -132,7 +132,7 @@ async def test_light_with_binary_sensor(
await hass.services.async_call(
LIGHT_DOMAIN,
SERVICE_TURN_OFF,
{ATTR_ENTITY_ID: f"{LIGHT_DOMAIN}.test"},
{ATTR_ENTITY_ID: f"{LIGHT_DOMAIN}.test_test"},
blocking=True,
) # In reality, this leads to a websocket message like already tested above
set_value.assert_called_once_with(False)
@@ -149,7 +149,7 @@ async def test_remove_from_hass(hass: HomeAssistant) -> None:
await hass.config_entries.async_setup(entry.entry_id)
await hass.async_block_till_done()
state = hass.states.get(f"{LIGHT_DOMAIN}.test")
state = hass.states.get(f"{LIGHT_DOMAIN}.test_test")
assert state is not None
await hass.config_entries.async_remove(entry.entry_id)
await hass.async_block_till_done()
@@ -31,9 +31,11 @@ async def test_brightness_sensor(
await hass.config_entries.async_setup(entry.entry_id)
await hass.async_block_till_done()
state = hass.states.get(f"{SENSOR_DOMAIN}.test_brightness")
state = hass.states.get(f"{SENSOR_DOMAIN}.test_test_brightness")
assert state == snapshot
assert entity_registry.async_get(f"{SENSOR_DOMAIN}.test_brightness") == snapshot
assert (
entity_registry.async_get(f"{SENSOR_DOMAIN}.test_test_brightness") == snapshot
)
async def test_temperature_sensor(
@@ -49,9 +51,11 @@ async def test_temperature_sensor(
await hass.config_entries.async_setup(entry.entry_id)
await hass.async_block_till_done()
state = hass.states.get(f"{SENSOR_DOMAIN}.test_temperature")
state = hass.states.get(f"{SENSOR_DOMAIN}.test_test_temperature")
assert state == snapshot
assert entity_registry.async_get(f"{SENSOR_DOMAIN}.test_temperature") == snapshot
assert (
entity_registry.async_get(f"{SENSOR_DOMAIN}.test_test_temperature") == snapshot
)
async def test_battery_sensor(
@@ -68,14 +72,14 @@ async def test_battery_sensor(
await hass.config_entries.async_setup(entry.entry_id)
await hass.async_block_till_done()
state = hass.states.get(f"{SENSOR_DOMAIN}.test_battery")
state = hass.states.get(f"{SENSOR_DOMAIN}.test_test_battery")
assert state == snapshot
assert entity_registry.async_get(f"{SENSOR_DOMAIN}.test_battery") == snapshot
assert entity_registry.async_get(f"{SENSOR_DOMAIN}.test_test_battery") == snapshot
# Emulate websocket message: value changed
test_gateway.publisher.dispatch("Test", ("Test", 10, "battery_level"))
await hass.async_block_till_done()
assert hass.states.get(f"{SENSOR_DOMAIN}.test_battery").state == "10"
assert hass.states.get(f"{SENSOR_DOMAIN}.test_test_battery").state == "10"
async def test_consumption_sensor(
@@ -91,26 +95,30 @@ async def test_consumption_sensor(
await hass.config_entries.async_setup(entry.entry_id)
await hass.async_block_till_done()
state = hass.states.get(f"{SENSOR_DOMAIN}.test_power")
state = hass.states.get(f"{SENSOR_DOMAIN}.test_test_power")
assert state == snapshot
assert entity_registry.async_get(f"{SENSOR_DOMAIN}.test_power") == snapshot
assert entity_registry.async_get(f"{SENSOR_DOMAIN}.test_test_power") == snapshot
state = hass.states.get(f"{SENSOR_DOMAIN}.test_energy")
state = hass.states.get(f"{SENSOR_DOMAIN}.test_test_energy")
assert state == snapshot
assert entity_registry.async_get(f"{SENSOR_DOMAIN}.test_energy") == snapshot
assert entity_registry.async_get(f"{SENSOR_DOMAIN}.test_test_energy") == snapshot
# Emulate websocket message: value changed
test_gateway.devices["Test"].consumption_property["devolo.Meter:Test"].total = 50.0
test_gateway.publisher.dispatch("Test", ("devolo.Meter:Test", 50.0))
await hass.async_block_till_done()
assert hass.states.get(f"{SENSOR_DOMAIN}.test_energy").state == "50.0"
assert hass.states.get(f"{SENSOR_DOMAIN}.test_test_energy").state == "50.0"
# Emulate websocket message: device went offline
test_gateway.devices["Test"].status = 1
test_gateway.publisher.dispatch("Test", ("Status", False, "status"))
await hass.async_block_till_done()
assert hass.states.get(f"{SENSOR_DOMAIN}.test_power").state == STATE_UNAVAILABLE
assert hass.states.get(f"{SENSOR_DOMAIN}.test_energy").state == STATE_UNAVAILABLE
assert (
hass.states.get(f"{SENSOR_DOMAIN}.test_test_power").state == STATE_UNAVAILABLE
)
assert (
hass.states.get(f"{SENSOR_DOMAIN}.test_test_energy").state == STATE_UNAVAILABLE
)
async def test_voltage_sensor(hass: HomeAssistant) -> None:
@@ -124,7 +132,7 @@ async def test_voltage_sensor(hass: HomeAssistant) -> None:
await hass.config_entries.async_setup(entry.entry_id)
await hass.async_block_till_done()
state = hass.states.get(f"{SENSOR_DOMAIN}.test_voltage")
state = hass.states.get(f"{SENSOR_DOMAIN}.test_test_voltage")
assert state is None
@@ -142,7 +150,7 @@ async def test_sensor_change(hass: HomeAssistant) -> None:
# Emulate websocket message: value changed
test_gateway.publisher.dispatch("Test", ("devolo.MultiLevelSensor:Test", 50.0))
await hass.async_block_till_done()
state = hass.states.get(f"{SENSOR_DOMAIN}.test_temperature")
state = hass.states.get(f"{SENSOR_DOMAIN}.test_test_temperature")
assert state.state == "50.0"
# Emulate websocket message: device went offline
@@ -150,7 +158,8 @@ async def test_sensor_change(hass: HomeAssistant) -> None:
test_gateway.publisher.dispatch("Test", ("Status", False, "status"))
await hass.async_block_till_done()
assert (
hass.states.get(f"{SENSOR_DOMAIN}.test_temperature").state == STATE_UNAVAILABLE
hass.states.get(f"{SENSOR_DOMAIN}.test_test_temperature").state
== STATE_UNAVAILABLE
)
@@ -165,7 +174,7 @@ async def test_remove_from_hass(hass: HomeAssistant) -> None:
await hass.config_entries.async_setup(entry.entry_id)
await hass.async_block_till_done()
state = hass.states.get(f"{SENSOR_DOMAIN}.test_temperature")
state = hass.states.get(f"{SENSOR_DOMAIN}.test_test_temperature")
assert state is not None
await hass.config_entries.async_remove(entry.entry_id)
await hass.async_block_till_done()
@@ -27,20 +27,20 @@ async def test_siren(
await hass.config_entries.async_setup(entry.entry_id)
await hass.async_block_till_done()
state = hass.states.get(f"{SIREN_DOMAIN}.test")
state = hass.states.get(f"{SIREN_DOMAIN}.test_test")
assert state == snapshot
assert entity_registry.async_get(f"{SIREN_DOMAIN}.test") == snapshot
assert entity_registry.async_get(f"{SIREN_DOMAIN}.test_test") == snapshot
# Emulate websocket message: sensor turned on
test_gateway.publisher.dispatch("Test", ("devolo.SirenMultiLevelSwitch:Test", 1))
await hass.async_block_till_done()
assert hass.states.get(f"{SIREN_DOMAIN}.test").state == STATE_ON
assert hass.states.get(f"{SIREN_DOMAIN}.test_test").state == STATE_ON
# Emulate websocket message: device went offline
test_gateway.devices["Test"].status = 1
test_gateway.publisher.dispatch("Test", ("Status", False, "status"))
await hass.async_block_till_done()
assert hass.states.get(f"{SIREN_DOMAIN}.test").state == STATE_UNAVAILABLE
assert hass.states.get(f"{SIREN_DOMAIN}.test_test").state == STATE_UNAVAILABLE
async def test_siren_switching(
@@ -57,9 +57,9 @@ async def test_siren_switching(
await hass.config_entries.async_setup(entry.entry_id)
await hass.async_block_till_done()
state = hass.states.get(f"{SIREN_DOMAIN}.test")
state = hass.states.get(f"{SIREN_DOMAIN}.test_test")
assert state == snapshot
assert entity_registry.async_get(f"{SIREN_DOMAIN}.test") == snapshot
assert entity_registry.async_get(f"{SIREN_DOMAIN}.test_test") == snapshot
with patch(
"devolo_home_control_api.properties.multi_level_switch_property.MultiLevelSwitchProperty.set"
@@ -67,7 +67,7 @@ async def test_siren_switching(
await hass.services.async_call(
"siren",
"turn_on",
{"entity_id": f"{SIREN_DOMAIN}.test"},
{"entity_id": f"{SIREN_DOMAIN}.test_test"},
blocking=True,
)
# The real device state is changed by a websocket message
@@ -83,7 +83,7 @@ async def test_siren_switching(
await hass.services.async_call(
"siren",
"turn_off",
{"entity_id": f"{SIREN_DOMAIN}.test"},
{"entity_id": f"{SIREN_DOMAIN}.test_test"},
blocking=True,
)
# The real device state is changed by a websocket message
@@ -91,7 +91,7 @@ async def test_siren_switching(
"Test", ("devolo.SirenMultiLevelSwitch:Test", 0)
)
await hass.async_block_till_done()
assert hass.states.get(f"{SIREN_DOMAIN}.test").state == STATE_OFF
assert hass.states.get(f"{SIREN_DOMAIN}.test_test").state == STATE_OFF
property_set.assert_called_once_with(0)
@@ -109,9 +109,9 @@ async def test_siren_change_default_tone(
await hass.config_entries.async_setup(entry.entry_id)
await hass.async_block_till_done()
state = hass.states.get(f"{SIREN_DOMAIN}.test")
state = hass.states.get(f"{SIREN_DOMAIN}.test_test")
assert state == snapshot
assert entity_registry.async_get(f"{SIREN_DOMAIN}.test") == snapshot
assert entity_registry.async_get(f"{SIREN_DOMAIN}.test_test") == snapshot
with patch(
"devolo_home_control_api.properties.multi_level_switch_property.MultiLevelSwitchProperty.set"
@@ -120,7 +120,7 @@ async def test_siren_change_default_tone(
await hass.services.async_call(
"siren",
"turn_on",
{"entity_id": f"{SIREN_DOMAIN}.test"},
{"entity_id": f"{SIREN_DOMAIN}.test_test"},
blocking=True,
)
property_set.assert_called_once_with(2)
@@ -137,7 +137,7 @@ async def test_remove_from_hass(hass: HomeAssistant) -> None:
await hass.config_entries.async_setup(entry.entry_id)
await hass.async_block_till_done()
state = hass.states.get(f"{SIREN_DOMAIN}.test")
state = hass.states.get(f"{SIREN_DOMAIN}.test_test")
assert state is not None
await hass.config_entries.async_remove(entry.entry_id)
await hass.async_block_till_done()
@@ -36,9 +36,9 @@ async def test_switch(
await hass.config_entries.async_setup(entry.entry_id)
await hass.async_block_till_done()
state = hass.states.get(f"{SWITCH_DOMAIN}.test")
state = hass.states.get(f"{SWITCH_DOMAIN}.test_test")
assert state == snapshot
assert entity_registry.async_get(f"{SWITCH_DOMAIN}.test") == snapshot
assert entity_registry.async_get(f"{SWITCH_DOMAIN}.test_test") == snapshot
# Emulate websocket message: switched on
test_gateway.devices["Test"].binary_switch_property[
@@ -46,7 +46,7 @@ async def test_switch(
].state = True
test_gateway.publisher.dispatch("Test", ("devolo.BinarySwitch:Test", True))
await hass.async_block_till_done()
assert hass.states.get(f"{SWITCH_DOMAIN}.test").state == STATE_ON
assert hass.states.get(f"{SWITCH_DOMAIN}.test_test").state == STATE_ON
with patch(
"devolo_home_control_api.properties.binary_switch_property.BinarySwitchProperty.set"
@@ -54,7 +54,7 @@ async def test_switch(
await hass.services.async_call(
SWITCH_DOMAIN,
SERVICE_TURN_ON,
{ATTR_ENTITY_ID: f"{SWITCH_DOMAIN}.test"},
{ATTR_ENTITY_ID: f"{SWITCH_DOMAIN}.test_test"},
blocking=True,
) # In reality, this leads to a websocket message like already tested above
set_value.assert_called_once_with(state=True)
@@ -63,7 +63,7 @@ async def test_switch(
await hass.services.async_call(
SWITCH_DOMAIN,
SERVICE_TURN_OFF,
{ATTR_ENTITY_ID: f"{SWITCH_DOMAIN}.test"},
{ATTR_ENTITY_ID: f"{SWITCH_DOMAIN}.test_test"},
blocking=True,
) # In reality, this leads to a websocket message like already tested above
set_value.assert_called_once_with(state=False)
@@ -72,14 +72,14 @@ async def test_switch(
test_gateway.devices["Test"].status = 1
test_gateway.publisher.dispatch("Test", ("Status", False, "status"))
await hass.async_block_till_done()
assert hass.states.get(f"{SWITCH_DOMAIN}.test").state == STATE_UNAVAILABLE
assert hass.states.get(f"{SWITCH_DOMAIN}.test_test").state == STATE_UNAVAILABLE
assert "Device Test is unavailable" in caplog.text
# Emulate websocket message: device went back online
test_gateway.devices["Test"].status = 0
test_gateway.publisher.dispatch("Test", ("Status", False, "status"))
await hass.async_block_till_done()
assert hass.states.get(f"{SWITCH_DOMAIN}.test").state == STATE_ON
assert hass.states.get(f"{SWITCH_DOMAIN}.test_test").state == STATE_ON
assert "Device Test is back online" in caplog.text
@@ -94,7 +94,7 @@ async def test_remove_from_hass(hass: HomeAssistant) -> None:
await hass.config_entries.async_setup(entry.entry_id)
await hass.async_block_till_done()
state = hass.states.get(f"{SWITCH_DOMAIN}.test")
state = hass.states.get(f"{SWITCH_DOMAIN}.test_test")
assert state is not None
await hass.config_entries.async_remove(entry.entry_id)
await hass.async_block_till_done()
@@ -1,5 +1,5 @@
# serializer version: 1
# name: test_setup[binary_sensor.mock_reeflex_light-entry]
# name: test_setup[binary_sensor.mock_aquarium_mock_reeflex_light-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
@@ -13,7 +13,7 @@
'disabled_by': None,
'domain': 'binary_sensor',
'entity_category': None,
'entity_id': 'binary_sensor.mock_reeflex_light',
'entity_id': 'binary_sensor.mock_aquarium_mock_reeflex_light',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -36,21 +36,21 @@
'unit_of_measurement': None,
})
# ---
# name: test_setup[binary_sensor.mock_reeflex_light-state]
# name: test_setup[binary_sensor.mock_aquarium_mock_reeflex_light-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'light',
'friendly_name': 'Mock reeflex Light',
}),
'context': <ANY>,
'entity_id': 'binary_sensor.mock_reeflex_light',
'entity_id': 'binary_sensor.mock_aquarium_mock_reeflex_light',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'off',
})
# ---
# name: test_setup[binary_sensor.mock_reeflex_uvc_lamp_connected-entry]
# name: test_setup[binary_sensor.mock_aquarium_mock_reeflex_uvc_lamp_connected-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
@@ -64,7 +64,7 @@
'disabled_by': None,
'domain': 'binary_sensor',
'entity_category': <EntityCategory.DIAGNOSTIC: 'diagnostic'>,
'entity_id': 'binary_sensor.mock_reeflex_uvc_lamp_connected',
'entity_id': 'binary_sensor.mock_aquarium_mock_reeflex_uvc_lamp_connected',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -87,14 +87,14 @@
'unit_of_measurement': None,
})
# ---
# name: test_setup[binary_sensor.mock_reeflex_uvc_lamp_connected-state]
# name: test_setup[binary_sensor.mock_aquarium_mock_reeflex_uvc_lamp_connected-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'connectivity',
'friendly_name': 'Mock reeflex UVC lamp connected',
}),
'context': <ANY>,
'entity_id': 'binary_sensor.mock_reeflex_uvc_lamp_connected',
'entity_id': 'binary_sensor.mock_aquarium_mock_reeflex_uvc_lamp_connected',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
@@ -1,5 +1,5 @@
# serializer version: 1
# name: test_dynamic_new_devices[climate.mock_heater-entry]
# name: test_dynamic_new_devices[climate.mock_aquarium_mock_heater-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
@@ -26,7 +26,7 @@
'disabled_by': None,
'domain': 'climate',
'entity_category': None,
'entity_id': 'climate.mock_heater',
'entity_id': 'climate.mock_aquarium_mock_heater',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -49,7 +49,7 @@
'unit_of_measurement': None,
})
# ---
# name: test_dynamic_new_devices[climate.mock_heater-state]
# name: test_dynamic_new_devices[climate.mock_aquarium_mock_heater-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'current_temperature': 24.2,
@@ -72,14 +72,14 @@
'temperature': 25.5,
}),
'context': <ANY>,
'entity_id': 'climate.mock_heater',
'entity_id': 'climate.mock_aquarium_mock_heater',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'auto',
})
# ---
# name: test_setup_heater[climate.mock_heater-entry]
# name: test_setup_heater[climate.mock_aquarium_mock_heater-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
@@ -106,7 +106,7 @@
'disabled_by': None,
'domain': 'climate',
'entity_category': None,
'entity_id': 'climate.mock_heater',
'entity_id': 'climate.mock_aquarium_mock_heater',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -129,7 +129,7 @@
'unit_of_measurement': None,
})
# ---
# name: test_setup_heater[climate.mock_heater-state]
# name: test_setup_heater[climate.mock_aquarium_mock_heater-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'current_temperature': 24.2,
@@ -152,7 +152,7 @@
'temperature': 25.5,
}),
'context': <ANY>,
'entity_id': 'climate.mock_heater',
'entity_id': 'climate.mock_aquarium_mock_heater',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
@@ -1,5 +1,5 @@
# serializer version: 1
# name: test_dynamic_new_devices[light.mock_classicledcontrol_e_channel_1-entry]
# name: test_dynamic_new_devices[light.mock_aquarium_mock_classicledcontrol_e_channel_1-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
@@ -20,7 +20,7 @@
'disabled_by': None,
'domain': 'light',
'entity_category': None,
'entity_id': 'light.mock_classicledcontrol_e_channel_1',
'entity_id': 'light.mock_aquarium_mock_classicledcontrol_e_channel_1',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -43,7 +43,7 @@
'unit_of_measurement': None,
})
# ---
# name: test_dynamic_new_devices[light.mock_classicledcontrol_e_channel_1-state]
# name: test_dynamic_new_devices[light.mock_aquarium_mock_classicledcontrol_e_channel_1-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'brightness': 99,
@@ -59,14 +59,14 @@
'supported_features': <LightEntityFeature: 4>,
}),
'context': <ANY>,
'entity_id': 'light.mock_classicledcontrol_e_channel_1',
'entity_id': 'light.mock_aquarium_mock_classicledcontrol_e_channel_1',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'on',
})
# ---
# name: test_setup_classic_led_ctrl[tankconfig0][light.mock_classicledcontrol_e_channel_0-entry]
# name: test_setup_classic_led_ctrl[tankconfig0][light.mock_aquarium_mock_classicledcontrol_e_channel_0-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
@@ -87,7 +87,7 @@
'disabled_by': None,
'domain': 'light',
'entity_category': None,
'entity_id': 'light.mock_classicledcontrol_e_channel_0',
'entity_id': 'light.mock_aquarium_mock_classicledcontrol_e_channel_0',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -110,7 +110,7 @@
'unit_of_measurement': None,
})
# ---
# name: test_setup_classic_led_ctrl[tankconfig0][light.mock_classicledcontrol_e_channel_0-state]
# name: test_setup_classic_led_ctrl[tankconfig0][light.mock_aquarium_mock_classicledcontrol_e_channel_0-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'brightness': 26,
@@ -126,14 +126,14 @@
'supported_features': <LightEntityFeature: 4>,
}),
'context': <ANY>,
'entity_id': 'light.mock_classicledcontrol_e_channel_0',
'entity_id': 'light.mock_aquarium_mock_classicledcontrol_e_channel_0',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'on',
})
# ---
# name: test_setup_classic_led_ctrl[tankconfig1][light.mock_classicledcontrol_e_channel_1-entry]
# name: test_setup_classic_led_ctrl[tankconfig1][light.mock_aquarium_mock_classicledcontrol_e_channel_1-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
@@ -154,7 +154,7 @@
'disabled_by': None,
'domain': 'light',
'entity_category': None,
'entity_id': 'light.mock_classicledcontrol_e_channel_1',
'entity_id': 'light.mock_aquarium_mock_classicledcontrol_e_channel_1',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -177,7 +177,7 @@
'unit_of_measurement': None,
})
# ---
# name: test_setup_classic_led_ctrl[tankconfig1][light.mock_classicledcontrol_e_channel_1-state]
# name: test_setup_classic_led_ctrl[tankconfig1][light.mock_aquarium_mock_classicledcontrol_e_channel_1-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'brightness': 99,
@@ -193,14 +193,14 @@
'supported_features': <LightEntityFeature: 4>,
}),
'context': <ANY>,
'entity_id': 'light.mock_classicledcontrol_e_channel_1',
'entity_id': 'light.mock_aquarium_mock_classicledcontrol_e_channel_1',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'on',
})
# ---
# name: test_setup_classic_led_ctrl[tankconfig2][light.mock_classicledcontrol_e_channel_0-entry]
# name: test_setup_classic_led_ctrl[tankconfig2][light.mock_aquarium_mock_classicledcontrol_e_channel_0-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
@@ -221,7 +221,7 @@
'disabled_by': None,
'domain': 'light',
'entity_category': None,
'entity_id': 'light.mock_classicledcontrol_e_channel_0',
'entity_id': 'light.mock_aquarium_mock_classicledcontrol_e_channel_0',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -244,7 +244,7 @@
'unit_of_measurement': None,
})
# ---
# name: test_setup_classic_led_ctrl[tankconfig2][light.mock_classicledcontrol_e_channel_0-state]
# name: test_setup_classic_led_ctrl[tankconfig2][light.mock_aquarium_mock_classicledcontrol_e_channel_0-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'brightness': 26,
@@ -260,14 +260,14 @@
'supported_features': <LightEntityFeature: 4>,
}),
'context': <ANY>,
'entity_id': 'light.mock_classicledcontrol_e_channel_0',
'entity_id': 'light.mock_aquarium_mock_classicledcontrol_e_channel_0',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'on',
})
# ---
# name: test_setup_classic_led_ctrl[tankconfig2][light.mock_classicledcontrol_e_channel_1-entry]
# name: test_setup_classic_led_ctrl[tankconfig2][light.mock_aquarium_mock_classicledcontrol_e_channel_1-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
@@ -288,7 +288,7 @@
'disabled_by': None,
'domain': 'light',
'entity_category': None,
'entity_id': 'light.mock_classicledcontrol_e_channel_1',
'entity_id': 'light.mock_aquarium_mock_classicledcontrol_e_channel_1',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -311,7 +311,7 @@
'unit_of_measurement': None,
})
# ---
# name: test_setup_classic_led_ctrl[tankconfig2][light.mock_classicledcontrol_e_channel_1-state]
# name: test_setup_classic_led_ctrl[tankconfig2][light.mock_aquarium_mock_classicledcontrol_e_channel_1-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'brightness': 99,
@@ -327,7 +327,7 @@
'supported_features': <LightEntityFeature: 4>,
}),
'context': <ANY>,
'entity_id': 'light.mock_classicledcontrol_e_channel_1',
'entity_id': 'light.mock_aquarium_mock_classicledcontrol_e_channel_1',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
@@ -1,5 +1,5 @@
# serializer version: 1
# name: test_setup[number.mock_classicledcontrol_e_system_led_brightness-entry]
# name: test_setup[number.mock_aquarium_mock_classicledcontrol_e_system_led_brightness-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
@@ -18,7 +18,7 @@
'disabled_by': None,
'domain': 'number',
'entity_category': <EntityCategory.CONFIG: 'config'>,
'entity_id': 'number.mock_classicledcontrol_e_system_led_brightness',
'entity_id': 'number.mock_aquarium_mock_classicledcontrol_e_system_led_brightness',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -41,7 +41,7 @@
'unit_of_measurement': '%',
})
# ---
# name: test_setup[number.mock_classicledcontrol_e_system_led_brightness-state]
# name: test_setup[number.mock_aquarium_mock_classicledcontrol_e_system_led_brightness-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'friendly_name': 'Mock classicLEDcontrol+e System LED brightness',
@@ -52,14 +52,14 @@
'unit_of_measurement': '%',
}),
'context': <ANY>,
'entity_id': 'number.mock_classicledcontrol_e_system_led_brightness',
'entity_id': 'number.mock_aquarium_mock_classicledcontrol_e_system_led_brightness',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'unknown',
})
# ---
# name: test_setup[number.mock_classicvario_day_speed-entry]
# name: test_setup[number.mock_aquarium_mock_classicvario_day_speed-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
@@ -78,7 +78,7 @@
'disabled_by': None,
'domain': 'number',
'entity_category': <EntityCategory.CONFIG: 'config'>,
'entity_id': 'number.mock_classicvario_day_speed',
'entity_id': 'number.mock_aquarium_mock_classicvario_day_speed',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -101,7 +101,7 @@
'unit_of_measurement': '%',
})
# ---
# name: test_setup[number.mock_classicvario_day_speed-state]
# name: test_setup[number.mock_aquarium_mock_classicvario_day_speed-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'friendly_name': 'Mock classicVARIO Day speed',
@@ -112,14 +112,14 @@
'unit_of_measurement': '%',
}),
'context': <ANY>,
'entity_id': 'number.mock_classicvario_day_speed',
'entity_id': 'number.mock_aquarium_mock_classicvario_day_speed',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'unknown',
})
# ---
# name: test_setup[number.mock_classicvario_manual_speed-entry]
# name: test_setup[number.mock_aquarium_mock_classicvario_manual_speed-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
@@ -138,7 +138,7 @@
'disabled_by': None,
'domain': 'number',
'entity_category': <EntityCategory.CONFIG: 'config'>,
'entity_id': 'number.mock_classicvario_manual_speed',
'entity_id': 'number.mock_aquarium_mock_classicvario_manual_speed',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -161,7 +161,7 @@
'unit_of_measurement': '%',
})
# ---
# name: test_setup[number.mock_classicvario_manual_speed-state]
# name: test_setup[number.mock_aquarium_mock_classicvario_manual_speed-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'friendly_name': 'Mock classicVARIO Manual speed',
@@ -172,14 +172,14 @@
'unit_of_measurement': '%',
}),
'context': <ANY>,
'entity_id': 'number.mock_classicvario_manual_speed',
'entity_id': 'number.mock_aquarium_mock_classicvario_manual_speed',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'unknown',
})
# ---
# name: test_setup[number.mock_classicvario_night_speed-entry]
# name: test_setup[number.mock_aquarium_mock_classicvario_night_speed-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
@@ -198,7 +198,7 @@
'disabled_by': None,
'domain': 'number',
'entity_category': <EntityCategory.CONFIG: 'config'>,
'entity_id': 'number.mock_classicvario_night_speed',
'entity_id': 'number.mock_aquarium_mock_classicvario_night_speed',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -221,7 +221,7 @@
'unit_of_measurement': '%',
})
# ---
# name: test_setup[number.mock_classicvario_night_speed-state]
# name: test_setup[number.mock_aquarium_mock_classicvario_night_speed-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'friendly_name': 'Mock classicVARIO Night speed',
@@ -232,14 +232,14 @@
'unit_of_measurement': '%',
}),
'context': <ANY>,
'entity_id': 'number.mock_classicvario_night_speed',
'entity_id': 'number.mock_aquarium_mock_classicvario_night_speed',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'unknown',
})
# ---
# name: test_setup[number.mock_classicvario_system_led_brightness-entry]
# name: test_setup[number.mock_aquarium_mock_classicvario_system_led_brightness-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
@@ -258,7 +258,7 @@
'disabled_by': None,
'domain': 'number',
'entity_category': <EntityCategory.CONFIG: 'config'>,
'entity_id': 'number.mock_classicvario_system_led_brightness',
'entity_id': 'number.mock_aquarium_mock_classicvario_system_led_brightness',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -281,7 +281,7 @@
'unit_of_measurement': '%',
})
# ---
# name: test_setup[number.mock_classicvario_system_led_brightness-state]
# name: test_setup[number.mock_aquarium_mock_classicvario_system_led_brightness-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'friendly_name': 'Mock classicVARIO System LED brightness',
@@ -292,14 +292,14 @@
'unit_of_measurement': '%',
}),
'context': <ANY>,
'entity_id': 'number.mock_classicvario_system_led_brightness',
'entity_id': 'number.mock_aquarium_mock_classicvario_system_led_brightness',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'unknown',
})
# ---
# name: test_setup[number.mock_filter_high_pulse_duration-entry]
# name: test_setup[number.mock_aquarium_mock_filter_high_pulse_duration-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
@@ -318,7 +318,7 @@
'disabled_by': None,
'domain': 'number',
'entity_category': <EntityCategory.CONFIG: 'config'>,
'entity_id': 'number.mock_filter_high_pulse_duration',
'entity_id': 'number.mock_aquarium_mock_filter_high_pulse_duration',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -341,7 +341,7 @@
'unit_of_measurement': <UnitOfTime.SECONDS: 's'>,
})
# ---
# name: test_setup[number.mock_filter_high_pulse_duration-state]
# name: test_setup[number.mock_aquarium_mock_filter_high_pulse_duration-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'duration',
@@ -353,14 +353,14 @@
'unit_of_measurement': <UnitOfTime.SECONDS: 's'>,
}),
'context': <ANY>,
'entity_id': 'number.mock_filter_high_pulse_duration',
'entity_id': 'number.mock_aquarium_mock_filter_high_pulse_duration',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'unknown',
})
# ---
# name: test_setup[number.mock_filter_low_pulse_duration-entry]
# name: test_setup[number.mock_aquarium_mock_filter_low_pulse_duration-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
@@ -379,7 +379,7 @@
'disabled_by': None,
'domain': 'number',
'entity_category': <EntityCategory.CONFIG: 'config'>,
'entity_id': 'number.mock_filter_low_pulse_duration',
'entity_id': 'number.mock_aquarium_mock_filter_low_pulse_duration',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -402,7 +402,7 @@
'unit_of_measurement': <UnitOfTime.SECONDS: 's'>,
})
# ---
# name: test_setup[number.mock_filter_low_pulse_duration-state]
# name: test_setup[number.mock_aquarium_mock_filter_low_pulse_duration-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'duration',
@@ -414,14 +414,14 @@
'unit_of_measurement': <UnitOfTime.SECONDS: 's'>,
}),
'context': <ANY>,
'entity_id': 'number.mock_filter_low_pulse_duration',
'entity_id': 'number.mock_aquarium_mock_filter_low_pulse_duration',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'unknown',
})
# ---
# name: test_setup[number.mock_filter_system_led_brightness-entry]
# name: test_setup[number.mock_aquarium_mock_filter_system_led_brightness-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
@@ -440,7 +440,7 @@
'disabled_by': None,
'domain': 'number',
'entity_category': <EntityCategory.CONFIG: 'config'>,
'entity_id': 'number.mock_filter_system_led_brightness',
'entity_id': 'number.mock_aquarium_mock_filter_system_led_brightness',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -463,7 +463,7 @@
'unit_of_measurement': '%',
})
# ---
# name: test_setup[number.mock_filter_system_led_brightness-state]
# name: test_setup[number.mock_aquarium_mock_filter_system_led_brightness-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'friendly_name': 'Mock filter System LED brightness',
@@ -474,14 +474,14 @@
'unit_of_measurement': '%',
}),
'context': <ANY>,
'entity_id': 'number.mock_filter_system_led_brightness',
'entity_id': 'number.mock_aquarium_mock_filter_system_led_brightness',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'unknown',
})
# ---
# name: test_setup[number.mock_heater_night_temperature_offset-entry]
# name: test_setup[number.mock_aquarium_mock_heater_night_temperature_offset-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
@@ -500,7 +500,7 @@
'disabled_by': None,
'domain': 'number',
'entity_category': <EntityCategory.CONFIG: 'config'>,
'entity_id': 'number.mock_heater_night_temperature_offset',
'entity_id': 'number.mock_aquarium_mock_heater_night_temperature_offset',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -523,7 +523,7 @@
'unit_of_measurement': None,
})
# ---
# name: test_setup[number.mock_heater_night_temperature_offset-state]
# name: test_setup[number.mock_aquarium_mock_heater_night_temperature_offset-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'temperature',
@@ -534,14 +534,14 @@
'step': 0.5,
}),
'context': <ANY>,
'entity_id': 'number.mock_heater_night_temperature_offset',
'entity_id': 'number.mock_aquarium_mock_heater_night_temperature_offset',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'unknown',
})
# ---
# name: test_setup[number.mock_heater_system_led_brightness-entry]
# name: test_setup[number.mock_aquarium_mock_heater_system_led_brightness-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
@@ -560,7 +560,7 @@
'disabled_by': None,
'domain': 'number',
'entity_category': <EntityCategory.CONFIG: 'config'>,
'entity_id': 'number.mock_heater_system_led_brightness',
'entity_id': 'number.mock_aquarium_mock_heater_system_led_brightness',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -583,7 +583,7 @@
'unit_of_measurement': '%',
})
# ---
# name: test_setup[number.mock_heater_system_led_brightness-state]
# name: test_setup[number.mock_aquarium_mock_heater_system_led_brightness-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'friendly_name': 'Mock Heater System LED brightness',
@@ -594,14 +594,14 @@
'unit_of_measurement': '%',
}),
'context': <ANY>,
'entity_id': 'number.mock_heater_system_led_brightness',
'entity_id': 'number.mock_aquarium_mock_heater_system_led_brightness',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'unknown',
})
# ---
# name: test_setup[number.mock_heater_temperature_offset-entry]
# name: test_setup[number.mock_aquarium_mock_heater_temperature_offset-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
@@ -620,7 +620,7 @@
'disabled_by': None,
'domain': 'number',
'entity_category': <EntityCategory.CONFIG: 'config'>,
'entity_id': 'number.mock_heater_temperature_offset',
'entity_id': 'number.mock_aquarium_mock_heater_temperature_offset',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -643,7 +643,7 @@
'unit_of_measurement': None,
})
# ---
# name: test_setup[number.mock_heater_temperature_offset-state]
# name: test_setup[number.mock_aquarium_mock_heater_temperature_offset-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'temperature',
@@ -654,14 +654,14 @@
'step': 0.1,
}),
'context': <ANY>,
'entity_id': 'number.mock_heater_temperature_offset',
'entity_id': 'number.mock_aquarium_mock_heater_temperature_offset',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'unknown',
})
# ---
# name: test_setup[number.mock_reeflex_booster_duration-entry]
# name: test_setup[number.mock_aquarium_mock_reeflex_booster_duration-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
@@ -680,7 +680,7 @@
'disabled_by': None,
'domain': 'number',
'entity_category': <EntityCategory.CONFIG: 'config'>,
'entity_id': 'number.mock_reeflex_booster_duration',
'entity_id': 'number.mock_aquarium_mock_reeflex_booster_duration',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -703,7 +703,7 @@
'unit_of_measurement': <UnitOfTime.MINUTES: 'min'>,
})
# ---
# name: test_setup[number.mock_reeflex_booster_duration-state]
# name: test_setup[number.mock_aquarium_mock_reeflex_booster_duration-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'duration',
@@ -715,14 +715,14 @@
'unit_of_measurement': <UnitOfTime.MINUTES: 'min'>,
}),
'context': <ANY>,
'entity_id': 'number.mock_reeflex_booster_duration',
'entity_id': 'number.mock_aquarium_mock_reeflex_booster_duration',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'unknown',
})
# ---
# name: test_setup[number.mock_reeflex_daily_burn_duration-entry]
# name: test_setup[number.mock_aquarium_mock_reeflex_daily_burn_duration-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
@@ -741,7 +741,7 @@
'disabled_by': None,
'domain': 'number',
'entity_category': <EntityCategory.CONFIG: 'config'>,
'entity_id': 'number.mock_reeflex_daily_burn_duration',
'entity_id': 'number.mock_aquarium_mock_reeflex_daily_burn_duration',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -764,7 +764,7 @@
'unit_of_measurement': <UnitOfTime.MINUTES: 'min'>,
})
# ---
# name: test_setup[number.mock_reeflex_daily_burn_duration-state]
# name: test_setup[number.mock_aquarium_mock_reeflex_daily_burn_duration-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'duration',
@@ -776,14 +776,14 @@
'unit_of_measurement': <UnitOfTime.MINUTES: 'min'>,
}),
'context': <ANY>,
'entity_id': 'number.mock_reeflex_daily_burn_duration',
'entity_id': 'number.mock_aquarium_mock_reeflex_daily_burn_duration',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'unknown',
})
# ---
# name: test_setup[number.mock_reeflex_pause_duration-entry]
# name: test_setup[number.mock_aquarium_mock_reeflex_pause_duration-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
@@ -802,7 +802,7 @@
'disabled_by': None,
'domain': 'number',
'entity_category': <EntityCategory.CONFIG: 'config'>,
'entity_id': 'number.mock_reeflex_pause_duration',
'entity_id': 'number.mock_aquarium_mock_reeflex_pause_duration',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -825,7 +825,7 @@
'unit_of_measurement': <UnitOfTime.MINUTES: 'min'>,
})
# ---
# name: test_setup[number.mock_reeflex_pause_duration-state]
# name: test_setup[number.mock_aquarium_mock_reeflex_pause_duration-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'duration',
@@ -837,14 +837,14 @@
'unit_of_measurement': <UnitOfTime.MINUTES: 'min'>,
}),
'context': <ANY>,
'entity_id': 'number.mock_reeflex_pause_duration',
'entity_id': 'number.mock_aquarium_mock_reeflex_pause_duration',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'unknown',
})
# ---
# name: test_setup[number.mock_reeflex_system_led_brightness-entry]
# name: test_setup[number.mock_aquarium_mock_reeflex_system_led_brightness-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
@@ -863,7 +863,7 @@
'disabled_by': None,
'domain': 'number',
'entity_category': <EntityCategory.CONFIG: 'config'>,
'entity_id': 'number.mock_reeflex_system_led_brightness',
'entity_id': 'number.mock_aquarium_mock_reeflex_system_led_brightness',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -886,7 +886,7 @@
'unit_of_measurement': '%',
})
# ---
# name: test_setup[number.mock_reeflex_system_led_brightness-state]
# name: test_setup[number.mock_aquarium_mock_reeflex_system_led_brightness-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'friendly_name': 'Mock reeflex System LED brightness',
@@ -897,7 +897,7 @@
'unit_of_measurement': '%',
}),
'context': <ANY>,
'entity_id': 'number.mock_reeflex_system_led_brightness',
'entity_id': 'number.mock_aquarium_mock_reeflex_system_led_brightness',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
@@ -1,5 +1,5 @@
# serializer version: 1
# name: test_setup[select.mock_classicvario_filter_mode-entry]
# name: test_setup[select.mock_aquarium_mock_classicvario_filter_mode-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
@@ -19,7 +19,7 @@
'disabled_by': None,
'domain': 'select',
'entity_category': None,
'entity_id': 'select.mock_classicvario_filter_mode',
'entity_id': 'select.mock_aquarium_mock_classicvario_filter_mode',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -42,7 +42,7 @@
'unit_of_measurement': None,
})
# ---
# name: test_setup[select.mock_classicvario_filter_mode-state]
# name: test_setup[select.mock_aquarium_mock_classicvario_filter_mode-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'friendly_name': 'Mock classicVARIO Filter mode',
@@ -53,14 +53,14 @@
]),
}),
'context': <ANY>,
'entity_id': 'select.mock_classicvario_filter_mode',
'entity_id': 'select.mock_aquarium_mock_classicvario_filter_mode',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'unknown',
})
# ---
# name: test_setup[select.mock_filter_constant_flow_speed-entry]
# name: test_setup[select.mock_aquarium_mock_filter_constant_flow_speed-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
@@ -92,7 +92,7 @@
'disabled_by': None,
'domain': 'select',
'entity_category': <EntityCategory.CONFIG: 'config'>,
'entity_id': 'select.mock_filter_constant_flow_speed',
'entity_id': 'select.mock_aquarium_mock_filter_constant_flow_speed',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -115,7 +115,7 @@
'unit_of_measurement': <UnitOfVolumeFlowRate.LITERS_PER_HOUR: 'L/h'>,
})
# ---
# name: test_setup[select.mock_filter_constant_flow_speed-state]
# name: test_setup[select.mock_aquarium_mock_filter_constant_flow_speed-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'friendly_name': 'Mock filter Constant flow speed',
@@ -139,14 +139,14 @@
'unit_of_measurement': <UnitOfVolumeFlowRate.LITERS_PER_HOUR: 'L/h'>,
}),
'context': <ANY>,
'entity_id': 'select.mock_filter_constant_flow_speed',
'entity_id': 'select.mock_aquarium_mock_filter_constant_flow_speed',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'unknown',
})
# ---
# name: test_setup[select.mock_filter_day_speed-entry]
# name: test_setup[select.mock_aquarium_mock_filter_day_speed-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
@@ -178,7 +178,7 @@
'disabled_by': None,
'domain': 'select',
'entity_category': <EntityCategory.CONFIG: 'config'>,
'entity_id': 'select.mock_filter_day_speed',
'entity_id': 'select.mock_aquarium_mock_filter_day_speed',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -201,7 +201,7 @@
'unit_of_measurement': <UnitOfVolumeFlowRate.LITERS_PER_HOUR: 'L/h'>,
})
# ---
# name: test_setup[select.mock_filter_day_speed-state]
# name: test_setup[select.mock_aquarium_mock_filter_day_speed-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'friendly_name': 'Mock filter Day speed',
@@ -225,14 +225,14 @@
'unit_of_measurement': <UnitOfVolumeFlowRate.LITERS_PER_HOUR: 'L/h'>,
}),
'context': <ANY>,
'entity_id': 'select.mock_filter_day_speed',
'entity_id': 'select.mock_aquarium_mock_filter_day_speed',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'unknown',
})
# ---
# name: test_setup[select.mock_filter_filter_mode-entry]
# name: test_setup[select.mock_aquarium_mock_filter_filter_mode-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
@@ -253,7 +253,7 @@
'disabled_by': None,
'domain': 'select',
'entity_category': <EntityCategory.CONFIG: 'config'>,
'entity_id': 'select.mock_filter_filter_mode',
'entity_id': 'select.mock_aquarium_mock_filter_filter_mode',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -276,7 +276,7 @@
'unit_of_measurement': None,
})
# ---
# name: test_setup[select.mock_filter_filter_mode-state]
# name: test_setup[select.mock_aquarium_mock_filter_filter_mode-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'friendly_name': 'Mock filter Filter mode',
@@ -288,14 +288,14 @@
]),
}),
'context': <ANY>,
'entity_id': 'select.mock_filter_filter_mode',
'entity_id': 'select.mock_aquarium_mock_filter_filter_mode',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'unknown',
})
# ---
# name: test_setup[select.mock_filter_high_pulse_speed-entry]
# name: test_setup[select.mock_aquarium_mock_filter_high_pulse_speed-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
@@ -327,7 +327,7 @@
'disabled_by': None,
'domain': 'select',
'entity_category': <EntityCategory.CONFIG: 'config'>,
'entity_id': 'select.mock_filter_high_pulse_speed',
'entity_id': 'select.mock_aquarium_mock_filter_high_pulse_speed',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -350,7 +350,7 @@
'unit_of_measurement': <UnitOfVolumeFlowRate.LITERS_PER_HOUR: 'L/h'>,
})
# ---
# name: test_setup[select.mock_filter_high_pulse_speed-state]
# name: test_setup[select.mock_aquarium_mock_filter_high_pulse_speed-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'friendly_name': 'Mock filter High pulse speed',
@@ -374,14 +374,14 @@
'unit_of_measurement': <UnitOfVolumeFlowRate.LITERS_PER_HOUR: 'L/h'>,
}),
'context': <ANY>,
'entity_id': 'select.mock_filter_high_pulse_speed',
'entity_id': 'select.mock_aquarium_mock_filter_high_pulse_speed',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'unknown',
})
# ---
# name: test_setup[select.mock_filter_low_pulse_speed-entry]
# name: test_setup[select.mock_aquarium_mock_filter_low_pulse_speed-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
@@ -413,7 +413,7 @@
'disabled_by': None,
'domain': 'select',
'entity_category': <EntityCategory.CONFIG: 'config'>,
'entity_id': 'select.mock_filter_low_pulse_speed',
'entity_id': 'select.mock_aquarium_mock_filter_low_pulse_speed',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -436,7 +436,7 @@
'unit_of_measurement': <UnitOfVolumeFlowRate.LITERS_PER_HOUR: 'L/h'>,
})
# ---
# name: test_setup[select.mock_filter_low_pulse_speed-state]
# name: test_setup[select.mock_aquarium_mock_filter_low_pulse_speed-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'friendly_name': 'Mock filter Low pulse speed',
@@ -460,14 +460,14 @@
'unit_of_measurement': <UnitOfVolumeFlowRate.LITERS_PER_HOUR: 'L/h'>,
}),
'context': <ANY>,
'entity_id': 'select.mock_filter_low_pulse_speed',
'entity_id': 'select.mock_aquarium_mock_filter_low_pulse_speed',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'unknown',
})
# ---
# name: test_setup[select.mock_filter_manual_speed-entry]
# name: test_setup[select.mock_aquarium_mock_filter_manual_speed-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
@@ -499,7 +499,7 @@
'disabled_by': None,
'domain': 'select',
'entity_category': <EntityCategory.CONFIG: 'config'>,
'entity_id': 'select.mock_filter_manual_speed',
'entity_id': 'select.mock_aquarium_mock_filter_manual_speed',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -522,7 +522,7 @@
'unit_of_measurement': <UnitOfFrequency.HERTZ: 'Hz'>,
})
# ---
# name: test_setup[select.mock_filter_manual_speed-state]
# name: test_setup[select.mock_aquarium_mock_filter_manual_speed-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'friendly_name': 'Mock filter Manual speed',
@@ -546,14 +546,14 @@
'unit_of_measurement': <UnitOfFrequency.HERTZ: 'Hz'>,
}),
'context': <ANY>,
'entity_id': 'select.mock_filter_manual_speed',
'entity_id': 'select.mock_aquarium_mock_filter_manual_speed',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'unknown',
})
# ---
# name: test_setup[select.mock_filter_night_speed-entry]
# name: test_setup[select.mock_aquarium_mock_filter_night_speed-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
@@ -585,7 +585,7 @@
'disabled_by': None,
'domain': 'select',
'entity_category': <EntityCategory.CONFIG: 'config'>,
'entity_id': 'select.mock_filter_night_speed',
'entity_id': 'select.mock_aquarium_mock_filter_night_speed',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -608,7 +608,7 @@
'unit_of_measurement': <UnitOfVolumeFlowRate.LITERS_PER_HOUR: 'L/h'>,
})
# ---
# name: test_setup[select.mock_filter_night_speed-state]
# name: test_setup[select.mock_aquarium_mock_filter_night_speed-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'friendly_name': 'Mock filter Night speed',
@@ -632,14 +632,14 @@
'unit_of_measurement': <UnitOfVolumeFlowRate.LITERS_PER_HOUR: 'L/h'>,
}),
'context': <ANY>,
'entity_id': 'select.mock_filter_night_speed',
'entity_id': 'select.mock_aquarium_mock_filter_night_speed',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'unknown',
})
# ---
# name: test_setup[select.mock_reeflex_operation_mode-entry]
# name: test_setup[select.mock_aquarium_mock_reeflex_operation_mode-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
@@ -658,7 +658,7 @@
'disabled_by': None,
'domain': 'select',
'entity_category': None,
'entity_id': 'select.mock_reeflex_operation_mode',
'entity_id': 'select.mock_aquarium_mock_reeflex_operation_mode',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -681,7 +681,7 @@
'unit_of_measurement': None,
})
# ---
# name: test_setup[select.mock_reeflex_operation_mode-state]
# name: test_setup[select.mock_aquarium_mock_reeflex_operation_mode-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'friendly_name': 'Mock reeflex Operation mode',
@@ -691,7 +691,7 @@
]),
}),
'context': <ANY>,
'entity_id': 'select.mock_reeflex_operation_mode',
'entity_id': 'select.mock_aquarium_mock_reeflex_operation_mode',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
@@ -1,5 +1,5 @@
# serializer version: 1
# name: test_setup[sensor.mock_classicvario_current_speed-entry]
# name: test_setup[sensor.mock_aquarium_mock_classicvario_current_speed-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
@@ -13,7 +13,7 @@
'disabled_by': None,
'domain': 'sensor',
'entity_category': None,
'entity_id': 'sensor.mock_classicvario_current_speed',
'entity_id': 'sensor.mock_aquarium_mock_classicvario_current_speed',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -36,21 +36,21 @@
'unit_of_measurement': '%',
})
# ---
# name: test_setup[sensor.mock_classicvario_current_speed-state]
# name: test_setup[sensor.mock_aquarium_mock_classicvario_current_speed-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'friendly_name': 'Mock classicVARIO Current speed',
'unit_of_measurement': '%',
}),
'context': <ANY>,
'entity_id': 'sensor.mock_classicvario_current_speed',
'entity_id': 'sensor.mock_aquarium_mock_classicvario_current_speed',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'unknown',
})
# ---
# name: test_setup[sensor.mock_classicvario_error_code-entry]
# name: test_setup[sensor.mock_aquarium_mock_classicvario_error_code-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
@@ -70,7 +70,7 @@
'disabled_by': None,
'domain': 'sensor',
'entity_category': <EntityCategory.DIAGNOSTIC: 'diagnostic'>,
'entity_id': 'sensor.mock_classicvario_error_code',
'entity_id': 'sensor.mock_aquarium_mock_classicvario_error_code',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -93,7 +93,7 @@
'unit_of_measurement': None,
})
# ---
# name: test_setup[sensor.mock_classicvario_error_code-state]
# name: test_setup[sensor.mock_aquarium_mock_classicvario_error_code-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'enum',
@@ -105,14 +105,14 @@
]),
}),
'context': <ANY>,
'entity_id': 'sensor.mock_classicvario_error_code',
'entity_id': 'sensor.mock_aquarium_mock_classicvario_error_code',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'unknown',
})
# ---
# name: test_setup[sensor.mock_classicvario_remaining_hours_until_service-entry]
# name: test_setup[sensor.mock_aquarium_mock_classicvario_remaining_hours_until_service-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
@@ -126,7 +126,7 @@
'disabled_by': None,
'domain': 'sensor',
'entity_category': <EntityCategory.DIAGNOSTIC: 'diagnostic'>,
'entity_id': 'sensor.mock_classicvario_remaining_hours_until_service',
'entity_id': 'sensor.mock_aquarium_mock_classicvario_remaining_hours_until_service',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -155,7 +155,7 @@
'unit_of_measurement': <UnitOfTime.DAYS: 'd'>,
})
# ---
# name: test_setup[sensor.mock_classicvario_remaining_hours_until_service-state]
# name: test_setup[sensor.mock_aquarium_mock_classicvario_remaining_hours_until_service-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'duration',
@@ -163,14 +163,14 @@
'unit_of_measurement': <UnitOfTime.DAYS: 'd'>,
}),
'context': <ANY>,
'entity_id': 'sensor.mock_classicvario_remaining_hours_until_service',
'entity_id': 'sensor.mock_aquarium_mock_classicvario_remaining_hours_until_service',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'unknown',
})
# ---
# name: test_setup[sensor.mock_filter_current_speed-entry]
# name: test_setup[sensor.mock_aquarium_mock_filter_current_speed-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
@@ -184,7 +184,7 @@
'disabled_by': None,
'domain': 'sensor',
'entity_category': None,
'entity_id': 'sensor.mock_filter_current_speed',
'entity_id': 'sensor.mock_aquarium_mock_filter_current_speed',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -210,7 +210,7 @@
'unit_of_measurement': <UnitOfFrequency.HERTZ: 'Hz'>,
})
# ---
# name: test_setup[sensor.mock_filter_current_speed-state]
# name: test_setup[sensor.mock_aquarium_mock_filter_current_speed-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'frequency',
@@ -218,14 +218,14 @@
'unit_of_measurement': <UnitOfFrequency.HERTZ: 'Hz'>,
}),
'context': <ANY>,
'entity_id': 'sensor.mock_filter_current_speed',
'entity_id': 'sensor.mock_aquarium_mock_filter_current_speed',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'unknown',
})
# ---
# name: test_setup[sensor.mock_filter_remaining_hours_until_service-entry]
# name: test_setup[sensor.mock_aquarium_mock_filter_remaining_hours_until_service-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
@@ -239,7 +239,7 @@
'disabled_by': None,
'domain': 'sensor',
'entity_category': <EntityCategory.DIAGNOSTIC: 'diagnostic'>,
'entity_id': 'sensor.mock_filter_remaining_hours_until_service',
'entity_id': 'sensor.mock_aquarium_mock_filter_remaining_hours_until_service',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -268,7 +268,7 @@
'unit_of_measurement': <UnitOfTime.DAYS: 'd'>,
})
# ---
# name: test_setup[sensor.mock_filter_remaining_hours_until_service-state]
# name: test_setup[sensor.mock_aquarium_mock_filter_remaining_hours_until_service-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'duration',
@@ -276,7 +276,7 @@
'unit_of_measurement': <UnitOfTime.DAYS: 'd'>,
}),
'context': <ANY>,
'entity_id': 'sensor.mock_filter_remaining_hours_until_service',
'entity_id': 'sensor.mock_aquarium_mock_filter_remaining_hours_until_service',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
@@ -1,5 +1,5 @@
# serializer version: 1
# name: test_setup[switch.mock_classicvario-entry]
# name: test_setup[switch.mock_aquarium_mock_classicvario-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
@@ -13,7 +13,7 @@
'disabled_by': None,
'domain': 'switch',
'entity_category': None,
'entity_id': 'switch.mock_classicvario',
'entity_id': 'switch.mock_aquarium_mock_classicvario',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -36,20 +36,20 @@
'unit_of_measurement': None,
})
# ---
# name: test_setup[switch.mock_classicvario-state]
# name: test_setup[switch.mock_aquarium_mock_classicvario-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'friendly_name': 'Mock classicVARIO',
}),
'context': <ANY>,
'entity_id': 'switch.mock_classicvario',
'entity_id': 'switch.mock_aquarium_mock_classicvario',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'on',
})
# ---
# name: test_setup[switch.mock_filter-entry]
# name: test_setup[switch.mock_aquarium_mock_filter-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
@@ -63,7 +63,7 @@
'disabled_by': None,
'domain': 'switch',
'entity_category': None,
'entity_id': 'switch.mock_filter',
'entity_id': 'switch.mock_aquarium_mock_filter',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -86,20 +86,20 @@
'unit_of_measurement': None,
})
# ---
# name: test_setup[switch.mock_filter-state]
# name: test_setup[switch.mock_aquarium_mock_filter-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'friendly_name': 'Mock filter',
}),
'context': <ANY>,
'entity_id': 'switch.mock_filter',
'entity_id': 'switch.mock_aquarium_mock_filter',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'on',
})
# ---
# name: test_setup[switch.mock_reeflex-entry]
# name: test_setup[switch.mock_aquarium_mock_reeflex-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
@@ -113,7 +113,7 @@
'disabled_by': None,
'domain': 'switch',
'entity_category': <EntityCategory.CONFIG: 'config'>,
'entity_id': 'switch.mock_reeflex',
'entity_id': 'switch.mock_aquarium_mock_reeflex',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -136,20 +136,20 @@
'unit_of_measurement': None,
})
# ---
# name: test_setup[switch.mock_reeflex-state]
# name: test_setup[switch.mock_aquarium_mock_reeflex-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'friendly_name': 'Mock reeflex',
}),
'context': <ANY>,
'entity_id': 'switch.mock_reeflex',
'entity_id': 'switch.mock_aquarium_mock_reeflex',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'unknown',
})
# ---
# name: test_setup[switch.mock_reeflex_booster-entry]
# name: test_setup[switch.mock_aquarium_mock_reeflex_booster-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
@@ -163,7 +163,7 @@
'disabled_by': None,
'domain': 'switch',
'entity_category': <EntityCategory.CONFIG: 'config'>,
'entity_id': 'switch.mock_reeflex_booster',
'entity_id': 'switch.mock_aquarium_mock_reeflex_booster',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -186,20 +186,20 @@
'unit_of_measurement': None,
})
# ---
# name: test_setup[switch.mock_reeflex_booster-state]
# name: test_setup[switch.mock_aquarium_mock_reeflex_booster-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'friendly_name': 'Mock reeflex Booster',
}),
'context': <ANY>,
'entity_id': 'switch.mock_reeflex_booster',
'entity_id': 'switch.mock_aquarium_mock_reeflex_booster',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'unknown',
})
# ---
# name: test_setup[switch.mock_reeflex_expert_mode-entry]
# name: test_setup[switch.mock_aquarium_mock_reeflex_expert_mode-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
@@ -213,7 +213,7 @@
'disabled_by': None,
'domain': 'switch',
'entity_category': <EntityCategory.CONFIG: 'config'>,
'entity_id': 'switch.mock_reeflex_expert_mode',
'entity_id': 'switch.mock_aquarium_mock_reeflex_expert_mode',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -236,20 +236,20 @@
'unit_of_measurement': None,
})
# ---
# name: test_setup[switch.mock_reeflex_expert_mode-state]
# name: test_setup[switch.mock_aquarium_mock_reeflex_expert_mode-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'friendly_name': 'Mock reeflex Expert mode',
}),
'context': <ANY>,
'entity_id': 'switch.mock_reeflex_expert_mode',
'entity_id': 'switch.mock_aquarium_mock_reeflex_expert_mode',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'unknown',
})
# ---
# name: test_setup[switch.mock_reeflex_pause-entry]
# name: test_setup[switch.mock_aquarium_mock_reeflex_pause-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
@@ -263,7 +263,7 @@
'disabled_by': None,
'domain': 'switch',
'entity_category': <EntityCategory.CONFIG: 'config'>,
'entity_id': 'switch.mock_reeflex_pause',
'entity_id': 'switch.mock_aquarium_mock_reeflex_pause',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -286,13 +286,13 @@
'unit_of_measurement': None,
})
# ---
# name: test_setup[switch.mock_reeflex_pause-state]
# name: test_setup[switch.mock_aquarium_mock_reeflex_pause-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'friendly_name': 'Mock reeflex Pause',
}),
'context': <ANY>,
'entity_id': 'switch.mock_reeflex_pause',
'entity_id': 'switch.mock_aquarium_mock_reeflex_pause',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
@@ -1,5 +1,5 @@
# serializer version: 1
# name: test_setup[time.mock_classicvario_day_start_time-entry]
# name: test_setup[time.mock_aquarium_mock_classicvario_day_start_time-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
@@ -13,7 +13,7 @@
'disabled_by': None,
'domain': 'time',
'entity_category': <EntityCategory.CONFIG: 'config'>,
'entity_id': 'time.mock_classicvario_day_start_time',
'entity_id': 'time.mock_aquarium_mock_classicvario_day_start_time',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -36,20 +36,20 @@
'unit_of_measurement': None,
})
# ---
# name: test_setup[time.mock_classicvario_day_start_time-state]
# name: test_setup[time.mock_aquarium_mock_classicvario_day_start_time-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'friendly_name': 'Mock classicVARIO Day start time',
}),
'context': <ANY>,
'entity_id': 'time.mock_classicvario_day_start_time',
'entity_id': 'time.mock_aquarium_mock_classicvario_day_start_time',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'unknown',
})
# ---
# name: test_setup[time.mock_classicvario_night_start_time-entry]
# name: test_setup[time.mock_aquarium_mock_classicvario_night_start_time-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
@@ -63,7 +63,7 @@
'disabled_by': None,
'domain': 'time',
'entity_category': <EntityCategory.CONFIG: 'config'>,
'entity_id': 'time.mock_classicvario_night_start_time',
'entity_id': 'time.mock_aquarium_mock_classicvario_night_start_time',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -86,20 +86,20 @@
'unit_of_measurement': None,
})
# ---
# name: test_setup[time.mock_classicvario_night_start_time-state]
# name: test_setup[time.mock_aquarium_mock_classicvario_night_start_time-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'friendly_name': 'Mock classicVARIO Night start time',
}),
'context': <ANY>,
'entity_id': 'time.mock_classicvario_night_start_time',
'entity_id': 'time.mock_aquarium_mock_classicvario_night_start_time',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'unknown',
})
# ---
# name: test_setup[time.mock_filter_day_start_time-entry]
# name: test_setup[time.mock_aquarium_mock_filter_day_start_time-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
@@ -113,7 +113,7 @@
'disabled_by': None,
'domain': 'time',
'entity_category': <EntityCategory.CONFIG: 'config'>,
'entity_id': 'time.mock_filter_day_start_time',
'entity_id': 'time.mock_aquarium_mock_filter_day_start_time',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -136,20 +136,20 @@
'unit_of_measurement': None,
})
# ---
# name: test_setup[time.mock_filter_day_start_time-state]
# name: test_setup[time.mock_aquarium_mock_filter_day_start_time-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'friendly_name': 'Mock filter Day start time',
}),
'context': <ANY>,
'entity_id': 'time.mock_filter_day_start_time',
'entity_id': 'time.mock_aquarium_mock_filter_day_start_time',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'unknown',
})
# ---
# name: test_setup[time.mock_filter_night_start_time-entry]
# name: test_setup[time.mock_aquarium_mock_filter_night_start_time-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
@@ -163,7 +163,7 @@
'disabled_by': None,
'domain': 'time',
'entity_category': <EntityCategory.CONFIG: 'config'>,
'entity_id': 'time.mock_filter_night_start_time',
'entity_id': 'time.mock_aquarium_mock_filter_night_start_time',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -186,20 +186,20 @@
'unit_of_measurement': None,
})
# ---
# name: test_setup[time.mock_filter_night_start_time-state]
# name: test_setup[time.mock_aquarium_mock_filter_night_start_time-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'friendly_name': 'Mock filter Night start time',
}),
'context': <ANY>,
'entity_id': 'time.mock_filter_night_start_time',
'entity_id': 'time.mock_aquarium_mock_filter_night_start_time',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'unknown',
})
# ---
# name: test_setup[time.mock_heater_day_start_time-entry]
# name: test_setup[time.mock_aquarium_mock_heater_day_start_time-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
@@ -213,7 +213,7 @@
'disabled_by': None,
'domain': 'time',
'entity_category': <EntityCategory.CONFIG: 'config'>,
'entity_id': 'time.mock_heater_day_start_time',
'entity_id': 'time.mock_aquarium_mock_heater_day_start_time',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -236,20 +236,20 @@
'unit_of_measurement': None,
})
# ---
# name: test_setup[time.mock_heater_day_start_time-state]
# name: test_setup[time.mock_aquarium_mock_heater_day_start_time-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'friendly_name': 'Mock Heater Day start time',
}),
'context': <ANY>,
'entity_id': 'time.mock_heater_day_start_time',
'entity_id': 'time.mock_aquarium_mock_heater_day_start_time',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'unknown',
})
# ---
# name: test_setup[time.mock_heater_night_start_time-entry]
# name: test_setup[time.mock_aquarium_mock_heater_night_start_time-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
@@ -263,7 +263,7 @@
'disabled_by': None,
'domain': 'time',
'entity_category': <EntityCategory.CONFIG: 'config'>,
'entity_id': 'time.mock_heater_night_start_time',
'entity_id': 'time.mock_aquarium_mock_heater_night_start_time',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -286,20 +286,20 @@
'unit_of_measurement': None,
})
# ---
# name: test_setup[time.mock_heater_night_start_time-state]
# name: test_setup[time.mock_aquarium_mock_heater_night_start_time-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'friendly_name': 'Mock Heater Night start time',
}),
'context': <ANY>,
'entity_id': 'time.mock_heater_night_start_time',
'entity_id': 'time.mock_aquarium_mock_heater_night_start_time',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'unknown',
})
# ---
# name: test_setup[time.mock_reeflex_start_time-entry]
# name: test_setup[time.mock_aquarium_mock_reeflex_start_time-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
@@ -313,7 +313,7 @@
'disabled_by': None,
'domain': 'time',
'entity_category': <EntityCategory.CONFIG: 'config'>,
'entity_id': 'time.mock_reeflex_start_time',
'entity_id': 'time.mock_aquarium_mock_reeflex_start_time',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -336,13 +336,13 @@
'unit_of_measurement': None,
})
# ---
# name: test_setup[time.mock_reeflex_start_time-state]
# name: test_setup[time.mock_aquarium_mock_reeflex_start_time-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'friendly_name': 'Mock reeflex Start time',
}),
'context': <ANY>,
'entity_id': 'time.mock_reeflex_start_time',
'entity_id': 'time.mock_aquarium_mock_reeflex_start_time',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
@@ -53,28 +53,28 @@ async def test_setup(
"reeflex_mock",
[
(
"binary_sensor.mock_reeflex_light",
"binary_sensor.mock_aquarium_mock_reeflex_light",
"reeflex_data",
"isLighting",
True,
"on",
),
(
"binary_sensor.mock_reeflex_light",
"binary_sensor.mock_aquarium_mock_reeflex_light",
"reeflex_data",
"isLighting",
False,
"off",
),
(
"binary_sensor.mock_reeflex_uvc_lamp_connected",
"binary_sensor.mock_aquarium_mock_reeflex_uvc_lamp_connected",
"reeflex_data",
"isUVCConnected",
True,
"on",
),
(
"binary_sensor.mock_reeflex_uvc_lamp_connected",
"binary_sensor.mock_aquarium_mock_reeflex_uvc_lamp_connected",
"reeflex_data",
"isUVCConnected",
False,
+23 -8
View File
@@ -136,7 +136,10 @@ async def test_set_preset_mode(
await hass.services.async_call(
CLIMATE_DOMAIN,
SERVICE_SET_PRESET_MODE,
{ATTR_ENTITY_ID: "climate.mock_heater", ATTR_PRESET_MODE: preset_mode},
{
ATTR_ENTITY_ID: "climate.mock_aquarium_mock_heater",
ATTR_PRESET_MODE: preset_mode,
},
blocking=True,
)
@@ -145,7 +148,10 @@ async def test_set_preset_mode(
await hass.services.async_call(
CLIMATE_DOMAIN,
SERVICE_SET_PRESET_MODE,
{ATTR_ENTITY_ID: "climate.mock_heater", ATTR_PRESET_MODE: preset_mode},
{
ATTR_ENTITY_ID: "climate.mock_aquarium_mock_heater",
ATTR_PRESET_MODE: preset_mode,
},
blocking=True,
)
@@ -173,7 +179,10 @@ async def test_set_temperature(
await hass.services.async_call(
CLIMATE_DOMAIN,
SERVICE_SET_TEMPERATURE,
{ATTR_ENTITY_ID: "climate.mock_heater", ATTR_TEMPERATURE: 26.0},
{
ATTR_ENTITY_ID: "climate.mock_aquarium_mock_heater",
ATTR_TEMPERATURE: 26.0,
},
blocking=True,
)
@@ -182,7 +191,7 @@ async def test_set_temperature(
await hass.services.async_call(
CLIMATE_DOMAIN,
SERVICE_SET_TEMPERATURE,
{ATTR_ENTITY_ID: "climate.mock_heater", ATTR_TEMPERATURE: 26.0},
{ATTR_ENTITY_ID: "climate.mock_aquarium_mock_heater", ATTR_TEMPERATURE: 26.0},
blocking=True,
)
@@ -215,7 +224,10 @@ async def test_set_hvac_mode(
await hass.services.async_call(
CLIMATE_DOMAIN,
SERVICE_SET_HVAC_MODE,
{ATTR_ENTITY_ID: "climate.mock_heater", ATTR_HVAC_MODE: hvac_mode},
{
ATTR_ENTITY_ID: "climate.mock_aquarium_mock_heater",
ATTR_HVAC_MODE: hvac_mode,
},
blocking=True,
)
@@ -224,7 +236,10 @@ async def test_set_hvac_mode(
await hass.services.async_call(
CLIMATE_DOMAIN,
SERVICE_SET_HVAC_MODE,
{ATTR_ENTITY_ID: "climate.mock_heater", ATTR_HVAC_MODE: hvac_mode},
{
ATTR_ENTITY_ID: "climate.mock_aquarium_mock_heater",
ATTR_HVAC_MODE: hvac_mode,
},
blocking=True,
)
@@ -250,7 +265,7 @@ async def test_state_update(
)
await hass.async_block_till_done()
assert (state := hass.states.get("climate.mock_heater"))
assert (state := hass.states.get("climate.mock_aquarium_mock_heater"))
assert state.attributes["hvac_action"] == HVACAction.IDLE
assert state.attributes["preset_mode"] == HEATER_BIO_MODE
@@ -260,6 +275,6 @@ async def test_state_update(
await eheimdigital_hub_mock.call_args.kwargs["receive_callback"]()
assert (state := hass.states.get("climate.mock_heater"))
assert (state := hass.states.get("climate.mock_aquarium_mock_heater"))
assert state.state == HVACMode.OFF
assert state.attributes["preset_mode"] == HEATER_SMART_MODE
+3 -1
View File
@@ -56,7 +56,9 @@ async def test_dynamic_entities(
await eheimdigital_hub_mock.call_args.kwargs["receive_callback"]()
assert hass.states.get("number.mock_heater_night_temperature_offset").state == str(
assert hass.states.get(
"number.mock_aquarium_mock_heater_night_temperature_offset"
).state == str(
eheimdigital_hub_mock.return_value.devices[
"00:00:00:00:00:02"
].night_temperature_offset
+11 -7
View File
@@ -135,7 +135,7 @@ async def test_turn_off(
await hass.services.async_call(
LIGHT_DOMAIN,
SERVICE_TURN_OFF,
{ATTR_ENTITY_ID: "light.mock_classicledcontrol_e_channel_1"},
{ATTR_ENTITY_ID: "light.mock_aquarium_mock_classicledcontrol_e_channel_1"},
blocking=True,
)
@@ -146,7 +146,7 @@ async def test_turn_off(
await hass.services.async_call(
LIGHT_DOMAIN,
SERVICE_TURN_OFF,
{ATTR_ENTITY_ID: "light.mock_classicledcontrol_e_channel_1"},
{ATTR_ENTITY_ID: "light.mock_aquarium_mock_classicledcontrol_e_channel_1"},
blocking=True,
)
@@ -191,7 +191,7 @@ async def test_turn_on_brightness(
LIGHT_DOMAIN,
SERVICE_TURN_ON,
{
ATTR_ENTITY_ID: "light.mock_classicledcontrol_e_channel_1",
ATTR_ENTITY_ID: "light.mock_aquarium_mock_classicledcontrol_e_channel_1",
ATTR_BRIGHTNESS: dim_input,
},
blocking=True,
@@ -205,7 +205,7 @@ async def test_turn_on_brightness(
LIGHT_DOMAIN,
SERVICE_TURN_ON,
{
ATTR_ENTITY_ID: "light.mock_classicledcontrol_e_channel_1",
ATTR_ENTITY_ID: "light.mock_aquarium_mock_classicledcontrol_e_channel_1",
ATTR_BRIGHTNESS: dim_input,
},
blocking=True,
@@ -241,7 +241,7 @@ async def test_turn_on_effect(
LIGHT_DOMAIN,
SERVICE_TURN_ON,
{
ATTR_ENTITY_ID: "light.mock_classicledcontrol_e_channel_1",
ATTR_ENTITY_ID: "light.mock_aquarium_mock_classicledcontrol_e_channel_1",
ATTR_EFFECT: EFFECT_DAYCL_MODE,
},
blocking=True,
@@ -274,7 +274,11 @@ async def test_state_update(
await eheimdigital_hub_mock.call_args.kwargs["receive_callback"]()
assert (state := hass.states.get("light.mock_classicledcontrol_e_channel_1"))
assert (
state := hass.states.get(
"light.mock_aquarium_mock_classicledcontrol_e_channel_1"
)
)
assert state.attributes["brightness"] == value_to_brightness((1, 100), 20)
@@ -299,6 +303,6 @@ async def test_update_failed(
await hass.async_block_till_done()
assert (
hass.states.get("light.mock_classicledcontrol_e_channel_1").state
hass.states.get("light.mock_aquarium_mock_classicledcontrol_e_channel_1").state
== STATE_UNAVAILABLE
)
+27 -27
View File
@@ -54,19 +54,19 @@ async def test_setup(
"heater_mock",
[
(
"number.mock_heater_temperature_offset",
"number.mock_aquarium_mock_heater_temperature_offset",
0.4,
"offset",
4,
),
(
"number.mock_heater_night_temperature_offset",
"number.mock_aquarium_mock_heater_night_temperature_offset",
0.4,
"nReduce",
4,
),
(
"number.mock_heater_system_led_brightness",
"number.mock_aquarium_mock_heater_system_led_brightness",
20,
"sysLED",
20,
@@ -77,25 +77,25 @@ async def test_setup(
"classic_vario_mock",
[
(
"number.mock_classicvario_manual_speed",
"number.mock_aquarium_mock_classicvario_manual_speed",
72.1,
"rel_manual_motor_speed",
int(72.1),
),
(
"number.mock_classicvario_day_speed",
"number.mock_aquarium_mock_classicvario_day_speed",
72.1,
"rel_motor_speed_day",
int(72.1),
),
(
"number.mock_classicvario_night_speed",
"number.mock_aquarium_mock_classicvario_night_speed",
72.1,
"rel_motor_speed_night",
int(72.1),
),
(
"number.mock_classicvario_system_led_brightness",
"number.mock_aquarium_mock_classicvario_system_led_brightness",
20,
"sysLED",
20,
@@ -106,13 +106,13 @@ async def test_setup(
"filter_mock",
[
(
"number.mock_filter_low_pulse_duration",
"number.mock_aquarium_mock_filter_low_pulse_duration",
20,
"time_low",
20,
),
(
"number.mock_filter_high_pulse_duration",
"number.mock_aquarium_mock_filter_high_pulse_duration",
20,
"time_high",
20,
@@ -123,25 +123,25 @@ async def test_setup(
"reeflex_mock",
[
(
"number.mock_reeflex_daily_burn_duration",
"number.mock_aquarium_mock_reeflex_daily_burn_duration",
20,
"dailyBurnTime",
20,
),
(
"number.mock_reeflex_booster_duration",
"number.mock_aquarium_mock_reeflex_booster_duration",
20,
"boosterTime",
20,
),
(
"number.mock_reeflex_pause_duration",
"number.mock_aquarium_mock_reeflex_pause_duration",
20,
"pauseTime",
20,
),
(
"number.mock_reeflex_system_led_brightness",
"number.mock_aquarium_mock_reeflex_system_led_brightness",
20,
"sysLED",
20,
@@ -186,21 +186,21 @@ async def test_set_value(
"heater_mock",
[
(
"number.mock_heater_temperature_offset",
"number.mock_aquarium_mock_heater_temperature_offset",
"heater_data",
"offset",
-11,
-1.1,
),
(
"number.mock_heater_night_temperature_offset",
"number.mock_aquarium_mock_heater_night_temperature_offset",
"heater_data",
"nReduce",
-23,
-2.3,
),
(
"number.mock_heater_system_led_brightness",
"number.mock_aquarium_mock_heater_system_led_brightness",
"usrdta",
"sysLED",
87,
@@ -212,28 +212,28 @@ async def test_set_value(
"classic_vario_mock",
[
(
"number.mock_classicvario_manual_speed",
"number.mock_aquarium_mock_classicvario_manual_speed",
"classic_vario_data",
"rel_manual_motor_speed",
34,
34,
),
(
"number.mock_classicvario_day_speed",
"number.mock_aquarium_mock_classicvario_day_speed",
"classic_vario_data",
"rel_motor_speed_day",
72,
72,
),
(
"number.mock_classicvario_night_speed",
"number.mock_aquarium_mock_classicvario_night_speed",
"classic_vario_data",
"rel_motor_speed_night",
20,
20,
),
(
"number.mock_classicvario_system_led_brightness",
"number.mock_aquarium_mock_classicvario_system_led_brightness",
"usrdta",
"sysLED",
20,
@@ -245,21 +245,21 @@ async def test_set_value(
"filter_mock",
[
(
"number.mock_filter_low_pulse_duration",
"number.mock_aquarium_mock_filter_low_pulse_duration",
"filter_data",
"pm_time_low",
20,
20,
),
(
"number.mock_filter_high_pulse_duration",
"number.mock_aquarium_mock_filter_high_pulse_duration",
"filter_data",
"pm_time_high",
20,
20,
),
(
"number.mock_filter_system_led_brightness",
"number.mock_aquarium_mock_filter_system_led_brightness",
"usrdta",
"sysLED",
20,
@@ -271,28 +271,28 @@ async def test_set_value(
"reeflex_mock",
[
(
"number.mock_reeflex_daily_burn_duration",
"number.mock_aquarium_mock_reeflex_daily_burn_duration",
"reeflex_data",
"dailyBurnTime",
20,
20,
),
(
"number.mock_reeflex_booster_duration",
"number.mock_aquarium_mock_reeflex_booster_duration",
"reeflex_data",
"boosterTime",
20,
20,
),
(
"number.mock_reeflex_pause_duration",
"number.mock_aquarium_mock_reeflex_pause_duration",
"reeflex_data",
"pauseTime",
20,
20,
),
(
"number.mock_reeflex_system_led_brightness",
"number.mock_aquarium_mock_reeflex_system_led_brightness",
"usrdta",
"sysLED",
100,
+43 -18
View File
@@ -55,7 +55,7 @@ async def test_setup(
"classic_vario_mock",
[
(
"select.mock_classicvario_filter_mode",
"select.mock_aquarium_mock_classicvario_filter_mode",
"manual",
"pumpMode",
int(FilterMode.MANUAL),
@@ -66,29 +66,54 @@ async def test_setup(
"filter_mock",
[
(
"select.mock_filter_filter_mode",
"select.mock_aquarium_mock_filter_filter_mode",
"constant_flow",
"title",
"START_FILTER_NORMAL_MODE_WITH_COMP",
),
(
"select.mock_filter_manual_speed",
"select.mock_aquarium_mock_filter_manual_speed",
"61.5",
"frequency",
int(61.5 * 100),
),
("select.mock_filter_constant_flow_speed", "440", "flow_rate", 1),
("select.mock_filter_day_speed", "480", "dfs_soll_day", 2),
("select.mock_filter_night_speed", "860", "dfs_soll_night", 14),
("select.mock_filter_high_pulse_speed", "620", "dfs_soll_high", 6),
("select.mock_filter_low_pulse_speed", "770", "dfs_soll_low", 11),
(
"select.mock_aquarium_mock_filter_constant_flow_speed",
"440",
"flow_rate",
1,
),
(
"select.mock_aquarium_mock_filter_day_speed",
"480",
"dfs_soll_day",
2,
),
(
"select.mock_aquarium_mock_filter_night_speed",
"860",
"dfs_soll_night",
14,
),
(
"select.mock_aquarium_mock_filter_high_pulse_speed",
"620",
"dfs_soll_high",
6,
),
(
"select.mock_aquarium_mock_filter_low_pulse_speed",
"770",
"dfs_soll_low",
11,
),
],
),
(
"reeflex_mock",
[
(
"select.mock_reeflex_operation_mode",
"select.mock_aquarium_mock_reeflex_operation_mode",
"constant",
"mode",
int(ReeflexMode.CONSTANT),
@@ -134,7 +159,7 @@ async def test_set_value(
"classic_vario_mock",
[
(
"select.mock_classicvario_filter_mode",
"select.mock_aquarium_mock_classicvario_filter_mode",
"classic_vario_data",
"pumpMode",
int(FilterMode.BIO),
@@ -146,49 +171,49 @@ async def test_set_value(
"filter_mock",
[
(
"select.mock_filter_filter_mode",
"select.mock_aquarium_mock_filter_filter_mode",
"filter_data",
"pumpMode",
int(FilterModeProf.CONSTANT_FLOW),
"constant_flow",
),
(
"select.mock_filter_manual_speed",
"select.mock_aquarium_mock_filter_manual_speed",
"filter_data",
"freqSoll",
int(61.5 * 100),
"61.5",
),
(
"select.mock_filter_constant_flow_speed",
"select.mock_aquarium_mock_filter_constant_flow_speed",
"filter_data",
"sollStep",
1,
"440",
),
(
"select.mock_filter_day_speed",
"select.mock_aquarium_mock_filter_day_speed",
"filter_data",
"nm_dfs_soll_day",
2,
"480",
),
(
"select.mock_filter_night_speed",
"select.mock_aquarium_mock_filter_night_speed",
"filter_data",
"nm_dfs_soll_night",
14,
"860",
),
(
"select.mock_filter_high_pulse_speed",
"select.mock_aquarium_mock_filter_high_pulse_speed",
"filter_data",
"pm_dfs_soll_high",
6,
"620",
),
(
"select.mock_filter_low_pulse_speed",
"select.mock_aquarium_mock_filter_low_pulse_speed",
"filter_data",
"pm_dfs_soll_low",
11,
@@ -200,7 +225,7 @@ async def test_set_value(
"reeflex_mock",
[
(
"select.mock_reeflex_operation_mode",
"select.mock_aquarium_mock_reeflex_operation_mode",
"reeflex_data",
"mode",
int(ReeflexMode.CONSTANT),
+5 -5
View File
@@ -50,21 +50,21 @@ async def test_setup(
"classic_vario_mock",
[
(
"sensor.mock_classicvario_current_speed",
"sensor.mock_aquarium_mock_classicvario_current_speed",
"classic_vario_data",
"rel_speed",
10,
10,
),
(
"sensor.mock_classicvario_error_code",
"sensor.mock_aquarium_mock_classicvario_error_code",
"classic_vario_data",
"errorCode",
int(FilterErrorCode.ROTOR_STUCK),
"rotor_stuck",
),
(
"sensor.mock_classicvario_remaining_hours_until_service",
"sensor.mock_aquarium_mock_classicvario_remaining_hours_until_service",
"classic_vario_data",
"serviceHour",
100,
@@ -76,14 +76,14 @@ async def test_setup(
"filter_mock",
[
(
"sensor.mock_filter_current_speed",
"sensor.mock_aquarium_mock_filter_current_speed",
"filter_data",
"freq",
7200,
str(round(72.0, 1)),
),
(
"sensor.mock_filter_remaining_hours_until_service",
"sensor.mock_aquarium_mock_filter_remaining_hours_until_service",
"filter_data",
"serviceHour",
100,
+22 -18
View File
@@ -54,12 +54,16 @@ async def test_setup(
@pytest.mark.parametrize(
("device_name", "entity_id", "property_name"),
[
("classic_vario_mock", "switch.mock_classicvario", "filterActive"),
("filter_mock", "switch.mock_filter", "active"),
("reeflex_mock", "switch.mock_reeflex", "isActive"),
("reeflex_mock", "switch.mock_reeflex_pause", "pause"),
("reeflex_mock", "switch.mock_reeflex_booster", "booster"),
("reeflex_mock", "switch.mock_reeflex_expert_mode", "expert"),
(
"classic_vario_mock",
"switch.mock_aquarium_mock_classicvario",
"filterActive",
),
("filter_mock", "switch.mock_aquarium_mock_filter", "active"),
("reeflex_mock", "switch.mock_aquarium_mock_reeflex", "isActive"),
("reeflex_mock", "switch.mock_aquarium_mock_reeflex_pause", "pause"),
("reeflex_mock", "switch.mock_aquarium_mock_reeflex_booster", "booster"),
("reeflex_mock", "switch.mock_aquarium_mock_reeflex_expert_mode", "expert"),
],
)
async def test_turn_on_off(
@@ -101,14 +105,14 @@ async def test_turn_on_off(
"classic_vario_mock",
[
(
"switch.mock_classicvario",
"switch.mock_aquarium_mock_classicvario",
"classic_vario_data",
"filterActive",
1,
"on",
),
(
"switch.mock_classicvario",
"switch.mock_aquarium_mock_classicvario",
"classic_vario_data",
"filterActive",
0,
@@ -120,14 +124,14 @@ async def test_turn_on_off(
"filter_mock",
[
(
"switch.mock_filter",
"switch.mock_aquarium_mock_filter",
"filter_data",
"filterActive",
1,
"on",
),
(
"switch.mock_filter",
"switch.mock_aquarium_mock_filter",
"filter_data",
"filterActive",
0,
@@ -139,56 +143,56 @@ async def test_turn_on_off(
"reeflex_mock",
[
(
"switch.mock_reeflex",
"switch.mock_aquarium_mock_reeflex",
"reeflex_data",
"isActive",
1,
"on",
),
(
"switch.mock_reeflex",
"switch.mock_aquarium_mock_reeflex",
"reeflex_data",
"isActive",
0,
"off",
),
(
"switch.mock_reeflex_pause",
"switch.mock_aquarium_mock_reeflex_pause",
"reeflex_data",
"pause",
1,
"on",
),
(
"switch.mock_reeflex_pause",
"switch.mock_aquarium_mock_reeflex_pause",
"reeflex_data",
"pause",
0,
"off",
),
(
"switch.mock_reeflex_booster",
"switch.mock_aquarium_mock_reeflex_booster",
"reeflex_data",
"booster",
1,
"on",
),
(
"switch.mock_reeflex_booster",
"switch.mock_aquarium_mock_reeflex_booster",
"reeflex_data",
"booster",
0,
"off",
),
(
"switch.mock_reeflex_expert_mode",
"switch.mock_aquarium_mock_reeflex_expert_mode",
"reeflex_data",
"expert",
1,
"on",
),
(
"switch.mock_reeflex_expert_mode",
"switch.mock_aquarium_mock_reeflex_expert_mode",
"reeflex_data",
"expert",
0,
+14 -14
View File
@@ -55,13 +55,13 @@ async def test_setup(
"heater_mock",
[
(
"time.mock_heater_day_start_time",
"time.mock_aquarium_mock_heater_day_start_time",
time(9, 0, tzinfo=timezone(timedelta(hours=1))),
"dayStartT",
9 * 60,
),
(
"time.mock_heater_night_start_time",
"time.mock_aquarium_mock_heater_night_start_time",
time(19, 0, tzinfo=timezone(timedelta(hours=1))),
"nightStartT",
19 * 60,
@@ -72,13 +72,13 @@ async def test_setup(
"classic_vario_mock",
[
(
"time.mock_classicvario_day_start_time",
"time.mock_aquarium_mock_classicvario_day_start_time",
time(9, 0, tzinfo=timezone(timedelta(hours=1))),
"startTime_day",
9 * 60,
),
(
"time.mock_classicvario_night_start_time",
"time.mock_aquarium_mock_classicvario_night_start_time",
time(19, 0, tzinfo=timezone(timedelta(hours=1))),
"startTime_night",
19 * 60,
@@ -89,13 +89,13 @@ async def test_setup(
"filter_mock",
[
(
"time.mock_filter_day_start_time",
"time.mock_aquarium_mock_filter_day_start_time",
time(9, 0, tzinfo=timezone(timedelta(hours=1))),
"end_time_night_mode",
9 * 60,
),
(
"time.mock_filter_night_start_time",
"time.mock_aquarium_mock_filter_night_start_time",
time(19, 0, tzinfo=timezone(timedelta(hours=1))),
"start_time_night_mode",
19 * 60,
@@ -106,7 +106,7 @@ async def test_setup(
"reeflex_mock",
[
(
"time.mock_reeflex_start_time",
"time.mock_aquarium_mock_reeflex_start_time",
time(9, 0, tzinfo=timezone(timedelta(hours=1))),
"startTime",
9 * 60,
@@ -151,14 +151,14 @@ async def test_set_value(
"heater_mock",
[
(
"time.mock_heater_day_start_time",
"time.mock_aquarium_mock_heater_day_start_time",
"heater_data",
"dayStartT",
540,
time(9, 0, tzinfo=timezone(timedelta(hours=1))).isoformat(),
),
(
"time.mock_heater_night_start_time",
"time.mock_aquarium_mock_heater_night_start_time",
"heater_data",
"nightStartT",
1140,
@@ -170,14 +170,14 @@ async def test_set_value(
"classic_vario_mock",
[
(
"time.mock_classicvario_day_start_time",
"time.mock_aquarium_mock_classicvario_day_start_time",
"classic_vario_data",
"startTime_day",
540,
time(9, 0, tzinfo=timezone(timedelta(hours=1))).isoformat(),
),
(
"time.mock_classicvario_night_start_time",
"time.mock_aquarium_mock_classicvario_night_start_time",
"classic_vario_data",
"startTime_night",
1320,
@@ -189,14 +189,14 @@ async def test_set_value(
"filter_mock",
[
(
"time.mock_filter_day_start_time",
"time.mock_aquarium_mock_filter_day_start_time",
"filter_data",
"end_time_night_mode",
540,
time(9, 0, tzinfo=timezone(timedelta(hours=1))).isoformat(),
),
(
"time.mock_filter_night_start_time",
"time.mock_aquarium_mock_filter_night_start_time",
"filter_data",
"start_time_night_mode",
1320,
@@ -208,7 +208,7 @@ async def test_set_value(
"reeflex_mock",
[
(
"time.mock_reeflex_start_time",
"time.mock_aquarium_mock_reeflex_start_time",
"reeflex_data",
"startTime",
540,
+4 -4
View File
@@ -88,7 +88,7 @@ async def test_binary_sensors(
assert sensor.attributes["device_class"] == "motion"
# test motion aware sensor
sensor = hass.states.get("binary_sensor.test_room_motion_aware_sensor_1")
sensor = hass.states.get("binary_sensor.test_room_test_room_motion_aware_sensor_1")
assert sensor is not None
assert sensor.state == "off"
assert sensor.name == "Test Room Motion Aware Sensor 1"
@@ -195,7 +195,7 @@ async def test_motion_aware_sensor(
await setup_platform(hass, mock_bridge_v2, Platform.BINARY_SENSOR)
# test motion aware sensor exists and has correct state
sensor = hass.states.get("binary_sensor.test_room_motion_aware_sensor_1")
sensor = hass.states.get("binary_sensor.test_room_test_room_motion_aware_sensor_1")
assert sensor is not None
assert sensor.state == "off"
assert sensor.attributes["device_class"] == "motion"
@@ -212,7 +212,7 @@ async def test_motion_aware_sensor(
}
mock_bridge_v2.api.emit_event("update", updated_sensor)
await hass.async_block_till_done()
sensor = hass.states.get("binary_sensor.test_room_motion_aware_sensor_1")
sensor = hass.states.get("binary_sensor.test_room_test_room_motion_aware_sensor_1")
assert sensor.state == "on"
# test name update when motion area configuration name changes
@@ -225,6 +225,6 @@ async def test_motion_aware_sensor(
await hass.async_block_till_done()
# The entity name is derived from the motion area configuration name
# but the entity ID doesn't change - we just verify the sensor still exists
sensor = hass.states.get("binary_sensor.test_room_motion_aware_sensor_1")
sensor = hass.states.get("binary_sensor.test_room_test_room_motion_aware_sensor_1")
assert sensor is not None
assert sensor.name == "Test Room Updated Motion Area"
+3 -3
View File
@@ -973,19 +973,19 @@ async def test_group_features(
device_entry = device_registry.async_get(entry.device_id)
assert device_entry.area_id is None
entry = entity_registry.async_get("light.hue_lamp_2")
entry = entity_registry.async_get("light.living_room_hue_lamp_2")
device_entry = device_registry.async_get(entry.device_id)
assert (
device_entry.area_id == area_registry.async_get_area_by_name("Living Room").id
)
entry = entity_registry.async_get("light.hue_lamp_3")
entry = entity_registry.async_get("light.living_room_hue_lamp_3")
device_entry = device_registry.async_get(entry.device_id)
assert (
device_entry.area_id == area_registry.async_get_area_by_name("Living Room").id
)
entry = entity_registry.async_get("light.hue_lamp_4")
entry = entity_registry.async_get("light.dining_room_hue_lamp_4")
device_entry = device_registry.async_get(entry.device_id)
assert (
device_entry.area_id == area_registry.async_get_area_by_name("Dining Room").id
+8 -8
View File
@@ -52,7 +52,7 @@ async def test_lights(
assert light_1.attributes["effect"] == "off"
# test light which supports color temperature only
light_2 = hass.states.get("light.hue_light_with_color_temperature_only")
light_2 = hass.states.get("light.test_room_hue_light_with_color_temperature_only")
assert light_2 is not None
assert (
light_2.attributes["friendly_name"] == "Hue light with color temperature only"
@@ -77,7 +77,7 @@ async def test_lights(
assert light_3.attributes["dynamics"] == "dynamic_palette"
# test light which supports on/off only
light_4 = hass.states.get("light.hue_on_off_light")
light_4 = hass.states.get("light.test_room_hue_on_off_light")
assert light_4 is not None
assert light_4.attributes["friendly_name"] == "Hue on/off light"
assert light_4.state == "off"
@@ -93,7 +93,7 @@ async def test_light_turn_on_service(
await setup_platform(hass, mock_bridge_v2, Platform.LIGHT)
test_light_id = "light.hue_light_with_color_temperature_only"
test_light_id = "light.test_room_hue_light_with_color_temperature_only"
# verify the light is off before we start
assert hass.states.get(test_light_id).state == "off"
@@ -428,7 +428,7 @@ async def test_grouped_lights(
await setup_platform(hass, mock_bridge_v2, Platform.LIGHT)
# test if entities for hue groups are created and enabled by default
for entity_id in ("light.test_zone", "light.test_room"):
for entity_id in ("light.test_zone", "light.test_room_test_room"):
entity_entry = entity_registry.async_get(entity_id)
assert entity_entry
@@ -463,7 +463,7 @@ async def test_grouped_lights(
}
# test light created for hue room
test_entity = hass.states.get("light.test_room")
test_entity = hass.states.get("light.test_room_test_room")
assert test_entity is not None
assert test_entity.attributes["friendly_name"] == "Test Room"
assert test_entity.state == "off"
@@ -481,8 +481,8 @@ async def test_grouped_lights(
"Hue light with color temperature only",
}
assert test_entity.attributes["entity_id"] == {
"light.hue_light_with_color_temperature_only",
"light.hue_on_off_light",
"light.test_room_hue_light_with_color_temperature_only",
"light.test_room_hue_on_off_light",
}
# Test calling the turn on service on a grouped light
@@ -1022,7 +1022,7 @@ async def test_light_turn_on_service_deprecation(
"""Test calling the turn on service on a light."""
await mock_bridge_v2.api.load_test_data(v2_resources_test_data)
test_light_id = "light.hue_light_with_color_temperature_only"
test_light_id = "light.test_room_hue_light_with_color_temperature_only"
await setup_platform(hass, mock_bridge_v2, Platform.LIGHT)
+7 -7
View File
@@ -41,7 +41,7 @@ async def test_scene(
assert test_entity.attributes["is_dynamic"] is True
# test (regular) scene for a hue room
test_entity = hass.states.get("scene.test_room_regular_test_scene")
test_entity = hass.states.get("scene.test_room_test_room_regular_test_scene")
assert test_entity is not None
assert test_entity.name == "Test Room Regular Test Scene"
assert test_entity.state == STATE_UNKNOWN
@@ -53,7 +53,7 @@ async def test_scene(
assert test_entity.attributes["is_dynamic"] is False
# test smart scene
test_entity = hass.states.get("scene.test_room_smart_test_scene")
test_entity = hass.states.get("scene.test_room_test_room_smart_test_scene")
assert test_entity is not None
assert test_entity.name == "Test Room Smart Test Scene"
assert test_entity.state == STATE_UNKNOWN
@@ -68,8 +68,8 @@ async def test_scene(
# scene entities should have be assigned to the room/zone device/service
for entity_id in (
"scene.test_zone_dynamic_test_scene",
"scene.test_room_regular_test_scene",
"scene.test_room_smart_test_scene",
"scene.test_room_test_room_regular_test_scene",
"scene.test_room_test_room_smart_test_scene",
):
entity_entry = entity_registry.async_get(entity_id)
assert entity_entry
@@ -84,7 +84,7 @@ async def test_scene_turn_on_service(
await setup_platform(hass, mock_bridge_v2, Platform.SCENE)
test_entity_id = "scene.test_room_regular_test_scene"
test_entity_id = "scene.test_room_test_room_regular_test_scene"
# call the HA turn_on service
await hass.services.async_call(
@@ -121,7 +121,7 @@ async def test_scene_advanced_turn_on_service(
await setup_platform(hass, mock_bridge_v2, Platform.SCENE)
test_entity_id = "scene.test_room_regular_test_scene"
test_entity_id = "scene.test_room_test_room_regular_test_scene"
# call the hue.activate_scene service
await hass.services.async_call(
@@ -158,7 +158,7 @@ async def test_scene_updates(
await setup_platform(hass, mock_bridge_v2, Platform.SCENE)
test_entity_id = "scene.test_room_mocked_scene"
test_entity_id = "scene.test_room_test_room_mocked_scene"
# verify entity does not exist before we start
assert hass.states.get(test_entity_id) is None
@@ -1,5 +1,5 @@
# serializer version: 1
# name: test_binary_sensor_snapshot[binary_sensor.test_mower_1_charging-entry]
# name: test_binary_sensor_snapshot[binary_sensor.garden_test_mower_1_charging-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
@@ -13,7 +13,7 @@
'disabled_by': None,
'domain': 'binary_sensor',
'entity_category': None,
'entity_id': 'binary_sensor.test_mower_1_charging',
'entity_id': 'binary_sensor.garden_test_mower_1_charging',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -36,21 +36,21 @@
'unit_of_measurement': None,
})
# ---
# name: test_binary_sensor_snapshot[binary_sensor.test_mower_1_charging-state]
# name: test_binary_sensor_snapshot[binary_sensor.garden_test_mower_1_charging-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'battery_charging',
'friendly_name': 'Test Mower 1 Charging',
}),
'context': <ANY>,
'entity_id': 'binary_sensor.test_mower_1_charging',
'entity_id': 'binary_sensor.garden_test_mower_1_charging',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'off',
})
# ---
# name: test_binary_sensor_snapshot[binary_sensor.test_mower_1_leaving_dock-entry]
# name: test_binary_sensor_snapshot[binary_sensor.garden_test_mower_1_leaving_dock-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
@@ -64,7 +64,7 @@
'disabled_by': None,
'domain': 'binary_sensor',
'entity_category': None,
'entity_id': 'binary_sensor.test_mower_1_leaving_dock',
'entity_id': 'binary_sensor.garden_test_mower_1_leaving_dock',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -87,20 +87,20 @@
'unit_of_measurement': None,
})
# ---
# name: test_binary_sensor_snapshot[binary_sensor.test_mower_1_leaving_dock-state]
# name: test_binary_sensor_snapshot[binary_sensor.garden_test_mower_1_leaving_dock-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'friendly_name': 'Test Mower 1 Leaving dock',
}),
'context': <ANY>,
'entity_id': 'binary_sensor.test_mower_1_leaving_dock',
'entity_id': 'binary_sensor.garden_test_mower_1_leaving_dock',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'off',
})
# ---
# name: test_binary_sensor_snapshot[binary_sensor.test_mower_2_charging-entry]
# name: test_binary_sensor_snapshot[binary_sensor.garden_test_mower_2_charging-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
@@ -114,7 +114,7 @@
'disabled_by': None,
'domain': 'binary_sensor',
'entity_category': None,
'entity_id': 'binary_sensor.test_mower_2_charging',
'entity_id': 'binary_sensor.garden_test_mower_2_charging',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -137,21 +137,21 @@
'unit_of_measurement': None,
})
# ---
# name: test_binary_sensor_snapshot[binary_sensor.test_mower_2_charging-state]
# name: test_binary_sensor_snapshot[binary_sensor.garden_test_mower_2_charging-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'battery_charging',
'friendly_name': 'Test Mower 2 Charging',
}),
'context': <ANY>,
'entity_id': 'binary_sensor.test_mower_2_charging',
'entity_id': 'binary_sensor.garden_test_mower_2_charging',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'off',
})
# ---
# name: test_binary_sensor_snapshot[binary_sensor.test_mower_2_leaving_dock-entry]
# name: test_binary_sensor_snapshot[binary_sensor.garden_test_mower_2_leaving_dock-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
@@ -165,7 +165,7 @@
'disabled_by': None,
'domain': 'binary_sensor',
'entity_category': None,
'entity_id': 'binary_sensor.test_mower_2_leaving_dock',
'entity_id': 'binary_sensor.garden_test_mower_2_leaving_dock',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -188,13 +188,13 @@
'unit_of_measurement': None,
})
# ---
# name: test_binary_sensor_snapshot[binary_sensor.test_mower_2_leaving_dock-state]
# name: test_binary_sensor_snapshot[binary_sensor.garden_test_mower_2_leaving_dock-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'friendly_name': 'Test Mower 2 Leaving dock',
}),
'context': <ANY>,
'entity_id': 'binary_sensor.test_mower_2_leaving_dock',
'entity_id': 'binary_sensor.garden_test_mower_2_leaving_dock',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
@@ -1,5 +1,5 @@
# serializer version: 1
# name: test_button_snapshot[button.test_mower_1_confirm_error-entry]
# name: test_button_snapshot[button.garden_test_mower_1_confirm_error-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
@@ -13,7 +13,7 @@
'disabled_by': None,
'domain': 'button',
'entity_category': None,
'entity_id': 'button.test_mower_1_confirm_error',
'entity_id': 'button.garden_test_mower_1_confirm_error',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -36,20 +36,20 @@
'unit_of_measurement': None,
})
# ---
# name: test_button_snapshot[button.test_mower_1_confirm_error-state]
# name: test_button_snapshot[button.garden_test_mower_1_confirm_error-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'friendly_name': 'Test Mower 1 Confirm error',
}),
'context': <ANY>,
'entity_id': 'button.test_mower_1_confirm_error',
'entity_id': 'button.garden_test_mower_1_confirm_error',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'unavailable',
})
# ---
# name: test_button_snapshot[button.test_mower_1_reset_cutting_blade_usage_time-entry]
# name: test_button_snapshot[button.garden_test_mower_1_reset_cutting_blade_usage_time-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
@@ -63,7 +63,7 @@
'disabled_by': None,
'domain': 'button',
'entity_category': None,
'entity_id': 'button.test_mower_1_reset_cutting_blade_usage_time',
'entity_id': 'button.garden_test_mower_1_reset_cutting_blade_usage_time',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -86,20 +86,20 @@
'unit_of_measurement': None,
})
# ---
# name: test_button_snapshot[button.test_mower_1_reset_cutting_blade_usage_time-state]
# name: test_button_snapshot[button.garden_test_mower_1_reset_cutting_blade_usage_time-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'friendly_name': 'Test Mower 1 Reset cutting blade usage time',
}),
'context': <ANY>,
'entity_id': 'button.test_mower_1_reset_cutting_blade_usage_time',
'entity_id': 'button.garden_test_mower_1_reset_cutting_blade_usage_time',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'unknown',
})
# ---
# name: test_button_snapshot[button.test_mower_1_sync_clock-entry]
# name: test_button_snapshot[button.garden_test_mower_1_sync_clock-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
@@ -113,7 +113,7 @@
'disabled_by': None,
'domain': 'button',
'entity_category': None,
'entity_id': 'button.test_mower_1_sync_clock',
'entity_id': 'button.garden_test_mower_1_sync_clock',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -136,20 +136,20 @@
'unit_of_measurement': None,
})
# ---
# name: test_button_snapshot[button.test_mower_1_sync_clock-state]
# name: test_button_snapshot[button.garden_test_mower_1_sync_clock-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'friendly_name': 'Test Mower 1 Sync clock',
}),
'context': <ANY>,
'entity_id': 'button.test_mower_1_sync_clock',
'entity_id': 'button.garden_test_mower_1_sync_clock',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'unknown',
})
# ---
# name: test_button_snapshot[button.test_mower_2_sync_clock-entry]
# name: test_button_snapshot[button.garden_test_mower_2_sync_clock-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
@@ -163,7 +163,7 @@
'disabled_by': None,
'domain': 'button',
'entity_category': None,
'entity_id': 'button.test_mower_2_sync_clock',
'entity_id': 'button.garden_test_mower_2_sync_clock',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -186,13 +186,13 @@
'unit_of_measurement': None,
})
# ---
# name: test_button_snapshot[button.test_mower_2_sync_clock-state]
# name: test_button_snapshot[button.garden_test_mower_2_sync_clock-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'friendly_name': 'Test Mower 2 Sync clock',
}),
'context': <ANY>,
'entity_id': 'button.test_mower_2_sync_clock',
'entity_id': 'button.garden_test_mower_2_sync_clock',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
@@ -1,7 +1,7 @@
# serializer version: 1
# name: test_calendar_snapshot[start_date0-end_date0]
dict({
'calendar.test_mower_1': dict({
'calendar.garden_test_mower_1': dict({
'events': list([
dict({
'end': '2023-06-05T09:00:00+02:00',
@@ -75,7 +75,7 @@
}),
]),
}),
'calendar.test_mower_2': dict({
'calendar.garden_test_mower_2': dict({
'events': list([
dict({
'end': '2023-06-05T02:49:00+02:00',
@@ -1,5 +1,5 @@
# serializer version: 1
# name: test_device_tracker_snapshot[device_tracker.test_mower_1-entry]
# name: test_device_tracker_snapshot[device_tracker.garden_test_mower_1-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
@@ -13,7 +13,7 @@
'disabled_by': None,
'domain': 'device_tracker',
'entity_category': <EntityCategory.DIAGNOSTIC: 'diagnostic'>,
'entity_id': 'device_tracker.test_mower_1',
'entity_id': 'device_tracker.garden_test_mower_1',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -36,7 +36,7 @@
'unit_of_measurement': None,
})
# ---
# name: test_device_tracker_snapshot[device_tracker.test_mower_1-state]
# name: test_device_tracker_snapshot[device_tracker.garden_test_mower_1-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'friendly_name': 'Test Mower 1',
@@ -48,7 +48,7 @@
'source_type': <SourceType.GPS: 'gps'>,
}),
'context': <ANY>,
'entity_id': 'device_tracker.test_mower_1',
'entity_id': 'device_tracker.garden_test_mower_1',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
@@ -1,5 +1,5 @@
# serializer version: 1
# name: test_event_snapshot[event.test_mower_1_message-entry]
# name: test_event_snapshot[event.garden_test_mower_1_message-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
@@ -138,7 +138,7 @@
'disabled_by': None,
'domain': 'event',
'entity_category': None,
'entity_id': 'event.test_mower_1_message',
'entity_id': 'event.garden_test_mower_1_message',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -161,7 +161,7 @@
'unit_of_measurement': None,
})
# ---
# name: test_event_snapshot[event.test_mower_1_message-state]
# name: test_event_snapshot[event.garden_test_mower_1_message-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'date_time': HAFakeDatetime(2025, 7, 13, 15, 30, tzinfo=datetime.timezone.utc),
@@ -296,7 +296,7 @@
'severity': <Severity.ERROR: 'error'>,
}),
'context': <ANY>,
'entity_id': 'event.test_mower_1_message',
'entity_id': 'event.garden_test_mower_1_message',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
@@ -1,5 +1,5 @@
# serializer version: 1
# name: test_number_snapshot[number.test_mower_1_back_lawn_cutting_height-entry]
# name: test_number_snapshot[number.garden_test_mower_1_back_lawn_cutting_height-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
@@ -18,7 +18,7 @@
'disabled_by': None,
'domain': 'number',
'entity_category': <EntityCategory.CONFIG: 'config'>,
'entity_id': 'number.test_mower_1_back_lawn_cutting_height',
'entity_id': 'number.garden_test_mower_1_back_lawn_cutting_height',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -41,7 +41,7 @@
'unit_of_measurement': '%',
})
# ---
# name: test_number_snapshot[number.test_mower_1_back_lawn_cutting_height-state]
# name: test_number_snapshot[number.garden_test_mower_1_back_lawn_cutting_height-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'friendly_name': 'Test Mower 1 Back lawn cutting height',
@@ -52,14 +52,14 @@
'unit_of_measurement': '%',
}),
'context': <ANY>,
'entity_id': 'number.test_mower_1_back_lawn_cutting_height',
'entity_id': 'number.garden_test_mower_1_back_lawn_cutting_height',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': '25',
})
# ---
# name: test_number_snapshot[number.test_mower_1_cutting_height-entry]
# name: test_number_snapshot[number.garden_test_mower_1_cutting_height-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
@@ -78,7 +78,7 @@
'disabled_by': None,
'domain': 'number',
'entity_category': <EntityCategory.CONFIG: 'config'>,
'entity_id': 'number.test_mower_1_cutting_height',
'entity_id': 'number.garden_test_mower_1_cutting_height',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -101,7 +101,7 @@
'unit_of_measurement': None,
})
# ---
# name: test_number_snapshot[number.test_mower_1_cutting_height-state]
# name: test_number_snapshot[number.garden_test_mower_1_cutting_height-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'friendly_name': 'Test Mower 1 Cutting height',
@@ -111,14 +111,14 @@
'step': 1.0,
}),
'context': <ANY>,
'entity_id': 'number.test_mower_1_cutting_height',
'entity_id': 'number.garden_test_mower_1_cutting_height',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': '4',
})
# ---
# name: test_number_snapshot[number.test_mower_1_front_lawn_cutting_height-entry]
# name: test_number_snapshot[number.garden_test_mower_1_front_lawn_cutting_height-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
@@ -137,7 +137,7 @@
'disabled_by': None,
'domain': 'number',
'entity_category': <EntityCategory.CONFIG: 'config'>,
'entity_id': 'number.test_mower_1_front_lawn_cutting_height',
'entity_id': 'number.garden_test_mower_1_front_lawn_cutting_height',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -160,7 +160,7 @@
'unit_of_measurement': '%',
})
# ---
# name: test_number_snapshot[number.test_mower_1_front_lawn_cutting_height-state]
# name: test_number_snapshot[number.garden_test_mower_1_front_lawn_cutting_height-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'friendly_name': 'Test Mower 1 Front lawn cutting height',
@@ -171,14 +171,14 @@
'unit_of_measurement': '%',
}),
'context': <ANY>,
'entity_id': 'number.test_mower_1_front_lawn_cutting_height',
'entity_id': 'number.garden_test_mower_1_front_lawn_cutting_height',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': '50',
})
# ---
# name: test_number_snapshot[number.test_mower_1_my_lawn_cutting_height-entry]
# name: test_number_snapshot[number.garden_test_mower_1_my_lawn_cutting_height-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
@@ -197,7 +197,7 @@
'disabled_by': None,
'domain': 'number',
'entity_category': <EntityCategory.CONFIG: 'config'>,
'entity_id': 'number.test_mower_1_my_lawn_cutting_height',
'entity_id': 'number.garden_test_mower_1_my_lawn_cutting_height',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -220,7 +220,7 @@
'unit_of_measurement': '%',
})
# ---
# name: test_number_snapshot[number.test_mower_1_my_lawn_cutting_height-state]
# name: test_number_snapshot[number.garden_test_mower_1_my_lawn_cutting_height-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'friendly_name': 'Test Mower 1 My lawn cutting height',
@@ -231,7 +231,7 @@
'unit_of_measurement': '%',
}),
'context': <ANY>,
'entity_id': 'number.test_mower_1_my_lawn_cutting_height',
'entity_id': 'number.garden_test_mower_1_my_lawn_cutting_height',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
@@ -1,5 +1,5 @@
# serializer version: 1
# name: test_sensor_snapshot[sensor.test_mower_1_battery-entry]
# name: test_sensor_snapshot[sensor.garden_test_mower_1_battery-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
@@ -15,7 +15,7 @@
'disabled_by': None,
'domain': 'sensor',
'entity_category': None,
'entity_id': 'sensor.test_mower_1_battery',
'entity_id': 'sensor.garden_test_mower_1_battery',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -38,7 +38,7 @@
'unit_of_measurement': '%',
})
# ---
# name: test_sensor_snapshot[sensor.test_mower_1_battery-state]
# name: test_sensor_snapshot[sensor.garden_test_mower_1_battery-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'battery',
@@ -47,14 +47,14 @@
'unit_of_measurement': '%',
}),
'context': <ANY>,
'entity_id': 'sensor.test_mower_1_battery',
'entity_id': 'sensor.garden_test_mower_1_battery',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': '100',
})
# ---
# name: test_sensor_snapshot[sensor.test_mower_1_cutting_blade_usage_time-entry]
# name: test_sensor_snapshot[sensor.garden_test_mower_1_cutting_blade_usage_time-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
@@ -70,7 +70,7 @@
'disabled_by': None,
'domain': 'sensor',
'entity_category': <EntityCategory.DIAGNOSTIC: 'diagnostic'>,
'entity_id': 'sensor.test_mower_1_cutting_blade_usage_time',
'entity_id': 'sensor.garden_test_mower_1_cutting_blade_usage_time',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -99,7 +99,7 @@
'unit_of_measurement': <UnitOfTime.HOURS: 'h'>,
})
# ---
# name: test_sensor_snapshot[sensor.test_mower_1_cutting_blade_usage_time-state]
# name: test_sensor_snapshot[sensor.garden_test_mower_1_cutting_blade_usage_time-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'duration',
@@ -108,14 +108,14 @@
'unit_of_measurement': <UnitOfTime.HOURS: 'h'>,
}),
'context': <ANY>,
'entity_id': 'sensor.test_mower_1_cutting_blade_usage_time',
'entity_id': 'sensor.garden_test_mower_1_cutting_blade_usage_time',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': '0.0341666666666667',
})
# ---
# name: test_sensor_snapshot[sensor.test_mower_1_downtime-entry]
# name: test_sensor_snapshot[sensor.garden_test_mower_1_downtime-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
@@ -131,7 +131,7 @@
'disabled_by': None,
'domain': 'sensor',
'entity_category': <EntityCategory.DIAGNOSTIC: 'diagnostic'>,
'entity_id': 'sensor.test_mower_1_downtime',
'entity_id': 'sensor.garden_test_mower_1_downtime',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -160,7 +160,7 @@
'unit_of_measurement': <UnitOfTime.HOURS: 'h'>,
})
# ---
# name: test_sensor_snapshot[sensor.test_mower_1_downtime-state]
# name: test_sensor_snapshot[sensor.garden_test_mower_1_downtime-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'duration',
@@ -169,14 +169,14 @@
'unit_of_measurement': <UnitOfTime.HOURS: 'h'>,
}),
'context': <ANY>,
'entity_id': 'sensor.test_mower_1_downtime',
'entity_id': 'sensor.garden_test_mower_1_downtime',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': '1.0',
})
# ---
# name: test_sensor_snapshot[sensor.test_mower_1_error-entry]
# name: test_sensor_snapshot[sensor.garden_test_mower_1_error-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
@@ -323,7 +323,7 @@
'disabled_by': None,
'domain': 'sensor',
'entity_category': None,
'entity_id': 'sensor.test_mower_1_error',
'entity_id': 'sensor.garden_test_mower_1_error',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -346,7 +346,7 @@
'unit_of_measurement': None,
})
# ---
# name: test_sensor_snapshot[sensor.test_mower_1_error-state]
# name: test_sensor_snapshot[sensor.garden_test_mower_1_error-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'enum',
@@ -485,14 +485,14 @@
]),
}),
'context': <ANY>,
'entity_id': 'sensor.test_mower_1_error',
'entity_id': 'sensor.garden_test_mower_1_error',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'no_error',
})
# ---
# name: test_sensor_snapshot[sensor.test_mower_1_front_lawn_last_time_completed-entry]
# name: test_sensor_snapshot[sensor.garden_test_mower_1_front_lawn_last_time_completed-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
@@ -506,7 +506,7 @@
'disabled_by': None,
'domain': 'sensor',
'entity_category': None,
'entity_id': 'sensor.test_mower_1_front_lawn_last_time_completed',
'entity_id': 'sensor.garden_test_mower_1_front_lawn_last_time_completed',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -529,21 +529,21 @@
'unit_of_measurement': None,
})
# ---
# name: test_sensor_snapshot[sensor.test_mower_1_front_lawn_last_time_completed-state]
# name: test_sensor_snapshot[sensor.garden_test_mower_1_front_lawn_last_time_completed-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'timestamp',
'friendly_name': 'Test Mower 1 Front lawn last time completed',
}),
'context': <ANY>,
'entity_id': 'sensor.test_mower_1_front_lawn_last_time_completed',
'entity_id': 'sensor.garden_test_mower_1_front_lawn_last_time_completed',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': '2024-08-12T05:54:29+00:00',
})
# ---
# name: test_sensor_snapshot[sensor.test_mower_1_front_lawn_progress-entry]
# name: test_sensor_snapshot[sensor.garden_test_mower_1_front_lawn_progress-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
@@ -559,7 +559,7 @@
'disabled_by': None,
'domain': 'sensor',
'entity_category': None,
'entity_id': 'sensor.test_mower_1_front_lawn_progress',
'entity_id': 'sensor.garden_test_mower_1_front_lawn_progress',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -582,7 +582,7 @@
'unit_of_measurement': '%',
})
# ---
# name: test_sensor_snapshot[sensor.test_mower_1_front_lawn_progress-state]
# name: test_sensor_snapshot[sensor.garden_test_mower_1_front_lawn_progress-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'friendly_name': 'Test Mower 1 Front lawn progress',
@@ -590,14 +590,14 @@
'unit_of_measurement': '%',
}),
'context': <ANY>,
'entity_id': 'sensor.test_mower_1_front_lawn_progress',
'entity_id': 'sensor.garden_test_mower_1_front_lawn_progress',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': '40',
})
# ---
# name: test_sensor_snapshot[sensor.test_mower_1_inactive_reason-entry]
# name: test_sensor_snapshot[sensor.garden_test_mower_1_inactive_reason-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
@@ -617,7 +617,7 @@
'disabled_by': None,
'domain': 'sensor',
'entity_category': None,
'entity_id': 'sensor.test_mower_1_inactive_reason',
'entity_id': 'sensor.garden_test_mower_1_inactive_reason',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -640,7 +640,7 @@
'unit_of_measurement': None,
})
# ---
# name: test_sensor_snapshot[sensor.test_mower_1_inactive_reason-state]
# name: test_sensor_snapshot[sensor.garden_test_mower_1_inactive_reason-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'enum',
@@ -652,14 +652,14 @@
]),
}),
'context': <ANY>,
'entity_id': 'sensor.test_mower_1_inactive_reason',
'entity_id': 'sensor.garden_test_mower_1_inactive_reason',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'none',
})
# ---
# name: test_sensor_snapshot[sensor.test_mower_1_mode-entry]
# name: test_sensor_snapshot[sensor.garden_test_mower_1_mode-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
@@ -682,7 +682,7 @@
'disabled_by': None,
'domain': 'sensor',
'entity_category': None,
'entity_id': 'sensor.test_mower_1_mode',
'entity_id': 'sensor.garden_test_mower_1_mode',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -705,7 +705,7 @@
'unit_of_measurement': None,
})
# ---
# name: test_sensor_snapshot[sensor.test_mower_1_mode-state]
# name: test_sensor_snapshot[sensor.garden_test_mower_1_mode-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'enum',
@@ -720,14 +720,14 @@
]),
}),
'context': <ANY>,
'entity_id': 'sensor.test_mower_1_mode',
'entity_id': 'sensor.garden_test_mower_1_mode',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'main_area',
})
# ---
# name: test_sensor_snapshot[sensor.test_mower_1_my_lawn_last_time_completed-entry]
# name: test_sensor_snapshot[sensor.garden_test_mower_1_my_lawn_last_time_completed-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
@@ -741,7 +741,7 @@
'disabled_by': None,
'domain': 'sensor',
'entity_category': None,
'entity_id': 'sensor.test_mower_1_my_lawn_last_time_completed',
'entity_id': 'sensor.garden_test_mower_1_my_lawn_last_time_completed',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -764,21 +764,21 @@
'unit_of_measurement': None,
})
# ---
# name: test_sensor_snapshot[sensor.test_mower_1_my_lawn_last_time_completed-state]
# name: test_sensor_snapshot[sensor.garden_test_mower_1_my_lawn_last_time_completed-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'timestamp',
'friendly_name': 'Test Mower 1 My lawn last time completed',
}),
'context': <ANY>,
'entity_id': 'sensor.test_mower_1_my_lawn_last_time_completed',
'entity_id': 'sensor.garden_test_mower_1_my_lawn_last_time_completed',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': '2024-08-12T03:07:49+00:00',
})
# ---
# name: test_sensor_snapshot[sensor.test_mower_1_my_lawn_progress-entry]
# name: test_sensor_snapshot[sensor.garden_test_mower_1_my_lawn_progress-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
@@ -794,7 +794,7 @@
'disabled_by': None,
'domain': 'sensor',
'entity_category': None,
'entity_id': 'sensor.test_mower_1_my_lawn_progress',
'entity_id': 'sensor.garden_test_mower_1_my_lawn_progress',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -817,7 +817,7 @@
'unit_of_measurement': '%',
})
# ---
# name: test_sensor_snapshot[sensor.test_mower_1_my_lawn_progress-state]
# name: test_sensor_snapshot[sensor.garden_test_mower_1_my_lawn_progress-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'friendly_name': 'Test Mower 1 My lawn progress',
@@ -825,14 +825,14 @@
'unit_of_measurement': '%',
}),
'context': <ANY>,
'entity_id': 'sensor.test_mower_1_my_lawn_progress',
'entity_id': 'sensor.garden_test_mower_1_my_lawn_progress',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': '20',
})
# ---
# name: test_sensor_snapshot[sensor.test_mower_1_next_start-entry]
# name: test_sensor_snapshot[sensor.garden_test_mower_1_next_start-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
@@ -846,7 +846,7 @@
'disabled_by': None,
'domain': 'sensor',
'entity_category': None,
'entity_id': 'sensor.test_mower_1_next_start',
'entity_id': 'sensor.garden_test_mower_1_next_start',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -869,21 +869,21 @@
'unit_of_measurement': None,
})
# ---
# name: test_sensor_snapshot[sensor.test_mower_1_next_start-state]
# name: test_sensor_snapshot[sensor.garden_test_mower_1_next_start-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'timestamp',
'friendly_name': 'Test Mower 1 Next start',
}),
'context': <ANY>,
'entity_id': 'sensor.test_mower_1_next_start',
'entity_id': 'sensor.garden_test_mower_1_next_start',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': '2023-06-05T17:00:00+00:00',
})
# ---
# name: test_sensor_snapshot[sensor.test_mower_1_number_of_charging_cycles-entry]
# name: test_sensor_snapshot[sensor.garden_test_mower_1_number_of_charging_cycles-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
@@ -899,7 +899,7 @@
'disabled_by': None,
'domain': 'sensor',
'entity_category': <EntityCategory.DIAGNOSTIC: 'diagnostic'>,
'entity_id': 'sensor.test_mower_1_number_of_charging_cycles',
'entity_id': 'sensor.garden_test_mower_1_number_of_charging_cycles',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -922,21 +922,21 @@
'unit_of_measurement': None,
})
# ---
# name: test_sensor_snapshot[sensor.test_mower_1_number_of_charging_cycles-state]
# name: test_sensor_snapshot[sensor.garden_test_mower_1_number_of_charging_cycles-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'friendly_name': 'Test Mower 1 Number of charging cycles',
'state_class': <SensorStateClass.TOTAL: 'total'>,
}),
'context': <ANY>,
'entity_id': 'sensor.test_mower_1_number_of_charging_cycles',
'entity_id': 'sensor.garden_test_mower_1_number_of_charging_cycles',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': '1380',
})
# ---
# name: test_sensor_snapshot[sensor.test_mower_1_number_of_collisions-entry]
# name: test_sensor_snapshot[sensor.garden_test_mower_1_number_of_collisions-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
@@ -952,7 +952,7 @@
'disabled_by': None,
'domain': 'sensor',
'entity_category': <EntityCategory.DIAGNOSTIC: 'diagnostic'>,
'entity_id': 'sensor.test_mower_1_number_of_collisions',
'entity_id': 'sensor.garden_test_mower_1_number_of_collisions',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -975,21 +975,21 @@
'unit_of_measurement': None,
})
# ---
# name: test_sensor_snapshot[sensor.test_mower_1_number_of_collisions-state]
# name: test_sensor_snapshot[sensor.garden_test_mower_1_number_of_collisions-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'friendly_name': 'Test Mower 1 Number of collisions',
'state_class': <SensorStateClass.TOTAL: 'total'>,
}),
'context': <ANY>,
'entity_id': 'sensor.test_mower_1_number_of_collisions',
'entity_id': 'sensor.garden_test_mower_1_number_of_collisions',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': '11396',
})
# ---
# name: test_sensor_snapshot[sensor.test_mower_1_remaining_charging_time-entry]
# name: test_sensor_snapshot[sensor.garden_test_mower_1_remaining_charging_time-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
@@ -1003,7 +1003,7 @@
'disabled_by': None,
'domain': 'sensor',
'entity_category': None,
'entity_id': 'sensor.test_mower_1_remaining_charging_time',
'entity_id': 'sensor.garden_test_mower_1_remaining_charging_time',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -1032,7 +1032,7 @@
'unit_of_measurement': <UnitOfTime.MINUTES: 'min'>,
})
# ---
# name: test_sensor_snapshot[sensor.test_mower_1_remaining_charging_time-state]
# name: test_sensor_snapshot[sensor.garden_test_mower_1_remaining_charging_time-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'duration',
@@ -1040,14 +1040,14 @@
'unit_of_measurement': <UnitOfTime.MINUTES: 'min'>,
}),
'context': <ANY>,
'entity_id': 'sensor.test_mower_1_remaining_charging_time',
'entity_id': 'sensor.garden_test_mower_1_remaining_charging_time',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': '5.15',
})
# ---
# name: test_sensor_snapshot[sensor.test_mower_1_restricted_reason-entry]
# name: test_sensor_snapshot[sensor.garden_test_mower_1_restricted_reason-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
@@ -1086,7 +1086,7 @@
'disabled_by': None,
'domain': 'sensor',
'entity_category': None,
'entity_id': 'sensor.test_mower_1_restricted_reason',
'entity_id': 'sensor.garden_test_mower_1_restricted_reason',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -1109,7 +1109,7 @@
'unit_of_measurement': None,
})
# ---
# name: test_sensor_snapshot[sensor.test_mower_1_restricted_reason-state]
# name: test_sensor_snapshot[sensor.garden_test_mower_1_restricted_reason-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'enum',
@@ -1140,14 +1140,14 @@
]),
}),
'context': <ANY>,
'entity_id': 'sensor.test_mower_1_restricted_reason',
'entity_id': 'sensor.garden_test_mower_1_restricted_reason',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'week_schedule',
})
# ---
# name: test_sensor_snapshot[sensor.test_mower_1_total_charging_time-entry]
# name: test_sensor_snapshot[sensor.garden_test_mower_1_total_charging_time-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
@@ -1163,7 +1163,7 @@
'disabled_by': None,
'domain': 'sensor',
'entity_category': <EntityCategory.DIAGNOSTIC: 'diagnostic'>,
'entity_id': 'sensor.test_mower_1_total_charging_time',
'entity_id': 'sensor.garden_test_mower_1_total_charging_time',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -1192,7 +1192,7 @@
'unit_of_measurement': <UnitOfTime.HOURS: 'h'>,
})
# ---
# name: test_sensor_snapshot[sensor.test_mower_1_total_charging_time-state]
# name: test_sensor_snapshot[sensor.garden_test_mower_1_total_charging_time-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'duration',
@@ -1201,14 +1201,14 @@
'unit_of_measurement': <UnitOfTime.HOURS: 'h'>,
}),
'context': <ANY>,
'entity_id': 'sensor.test_mower_1_total_charging_time',
'entity_id': 'sensor.garden_test_mower_1_total_charging_time',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': '1204.0',
})
# ---
# name: test_sensor_snapshot[sensor.test_mower_1_total_cutting_time-entry]
# name: test_sensor_snapshot[sensor.garden_test_mower_1_total_cutting_time-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
@@ -1224,7 +1224,7 @@
'disabled_by': None,
'domain': 'sensor',
'entity_category': <EntityCategory.DIAGNOSTIC: 'diagnostic'>,
'entity_id': 'sensor.test_mower_1_total_cutting_time',
'entity_id': 'sensor.garden_test_mower_1_total_cutting_time',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -1253,7 +1253,7 @@
'unit_of_measurement': <UnitOfTime.HOURS: 'h'>,
})
# ---
# name: test_sensor_snapshot[sensor.test_mower_1_total_cutting_time-state]
# name: test_sensor_snapshot[sensor.garden_test_mower_1_total_cutting_time-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'duration',
@@ -1262,14 +1262,14 @@
'unit_of_measurement': <UnitOfTime.HOURS: 'h'>,
}),
'context': <ANY>,
'entity_id': 'sensor.test_mower_1_total_cutting_time',
'entity_id': 'sensor.garden_test_mower_1_total_cutting_time',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': '1165.0',
})
# ---
# name: test_sensor_snapshot[sensor.test_mower_1_total_drive_distance-entry]
# name: test_sensor_snapshot[sensor.garden_test_mower_1_total_drive_distance-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
@@ -1285,7 +1285,7 @@
'disabled_by': None,
'domain': 'sensor',
'entity_category': <EntityCategory.DIAGNOSTIC: 'diagnostic'>,
'entity_id': 'sensor.test_mower_1_total_drive_distance',
'entity_id': 'sensor.garden_test_mower_1_total_drive_distance',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -1314,7 +1314,7 @@
'unit_of_measurement': <UnitOfLength.KILOMETERS: 'km'>,
})
# ---
# name: test_sensor_snapshot[sensor.test_mower_1_total_drive_distance-state]
# name: test_sensor_snapshot[sensor.garden_test_mower_1_total_drive_distance-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'distance',
@@ -1323,14 +1323,14 @@
'unit_of_measurement': <UnitOfLength.KILOMETERS: 'km'>,
}),
'context': <ANY>,
'entity_id': 'sensor.test_mower_1_total_drive_distance',
'entity_id': 'sensor.garden_test_mower_1_total_drive_distance',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': '1780.272',
})
# ---
# name: test_sensor_snapshot[sensor.test_mower_1_total_running_time-entry]
# name: test_sensor_snapshot[sensor.garden_test_mower_1_total_running_time-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
@@ -1346,7 +1346,7 @@
'disabled_by': None,
'domain': 'sensor',
'entity_category': <EntityCategory.DIAGNOSTIC: 'diagnostic'>,
'entity_id': 'sensor.test_mower_1_total_running_time',
'entity_id': 'sensor.garden_test_mower_1_total_running_time',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -1375,7 +1375,7 @@
'unit_of_measurement': <UnitOfTime.HOURS: 'h'>,
})
# ---
# name: test_sensor_snapshot[sensor.test_mower_1_total_running_time-state]
# name: test_sensor_snapshot[sensor.garden_test_mower_1_total_running_time-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'duration',
@@ -1384,14 +1384,14 @@
'unit_of_measurement': <UnitOfTime.HOURS: 'h'>,
}),
'context': <ANY>,
'entity_id': 'sensor.test_mower_1_total_running_time',
'entity_id': 'sensor.garden_test_mower_1_total_running_time',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': '1268.0',
})
# ---
# name: test_sensor_snapshot[sensor.test_mower_1_total_searching_time-entry]
# name: test_sensor_snapshot[sensor.garden_test_mower_1_total_searching_time-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
@@ -1407,7 +1407,7 @@
'disabled_by': None,
'domain': 'sensor',
'entity_category': <EntityCategory.DIAGNOSTIC: 'diagnostic'>,
'entity_id': 'sensor.test_mower_1_total_searching_time',
'entity_id': 'sensor.garden_test_mower_1_total_searching_time',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -1436,7 +1436,7 @@
'unit_of_measurement': <UnitOfTime.HOURS: 'h'>,
})
# ---
# name: test_sensor_snapshot[sensor.test_mower_1_total_searching_time-state]
# name: test_sensor_snapshot[sensor.garden_test_mower_1_total_searching_time-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'duration',
@@ -1445,14 +1445,14 @@
'unit_of_measurement': <UnitOfTime.HOURS: 'h'>,
}),
'context': <ANY>,
'entity_id': 'sensor.test_mower_1_total_searching_time',
'entity_id': 'sensor.garden_test_mower_1_total_searching_time',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': '103.0',
})
# ---
# name: test_sensor_snapshot[sensor.test_mower_1_uptime-entry]
# name: test_sensor_snapshot[sensor.garden_test_mower_1_uptime-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
@@ -1468,7 +1468,7 @@
'disabled_by': None,
'domain': 'sensor',
'entity_category': <EntityCategory.DIAGNOSTIC: 'diagnostic'>,
'entity_id': 'sensor.test_mower_1_uptime',
'entity_id': 'sensor.garden_test_mower_1_uptime',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -1497,7 +1497,7 @@
'unit_of_measurement': <UnitOfTime.HOURS: 'h'>,
})
# ---
# name: test_sensor_snapshot[sensor.test_mower_1_uptime-state]
# name: test_sensor_snapshot[sensor.garden_test_mower_1_uptime-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'duration',
@@ -1506,14 +1506,14 @@
'unit_of_measurement': <UnitOfTime.HOURS: 'h'>,
}),
'context': <ANY>,
'entity_id': 'sensor.test_mower_1_uptime',
'entity_id': 'sensor.garden_test_mower_1_uptime',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': '2.0',
})
# ---
# name: test_sensor_snapshot[sensor.test_mower_1_work_area-entry]
# name: test_sensor_snapshot[sensor.garden_test_mower_1_work_area-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
@@ -1534,7 +1534,7 @@
'disabled_by': None,
'domain': 'sensor',
'entity_category': None,
'entity_id': 'sensor.test_mower_1_work_area',
'entity_id': 'sensor.garden_test_mower_1_work_area',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -1557,7 +1557,7 @@
'unit_of_measurement': None,
})
# ---
# name: test_sensor_snapshot[sensor.test_mower_1_work_area-state]
# name: test_sensor_snapshot[sensor.garden_test_mower_1_work_area-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'enum',
@@ -1575,14 +1575,14 @@
}),
}),
'context': <ANY>,
'entity_id': 'sensor.test_mower_1_work_area',
'entity_id': 'sensor.garden_test_mower_1_work_area',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'Front lawn',
})
# ---
# name: test_sensor_snapshot[sensor.test_mower_2_battery-entry]
# name: test_sensor_snapshot[sensor.garden_test_mower_2_battery-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
@@ -1598,7 +1598,7 @@
'disabled_by': None,
'domain': 'sensor',
'entity_category': None,
'entity_id': 'sensor.test_mower_2_battery',
'entity_id': 'sensor.garden_test_mower_2_battery',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -1621,7 +1621,7 @@
'unit_of_measurement': '%',
})
# ---
# name: test_sensor_snapshot[sensor.test_mower_2_battery-state]
# name: test_sensor_snapshot[sensor.garden_test_mower_2_battery-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'battery',
@@ -1630,14 +1630,14 @@
'unit_of_measurement': '%',
}),
'context': <ANY>,
'entity_id': 'sensor.test_mower_2_battery',
'entity_id': 'sensor.garden_test_mower_2_battery',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': '50',
})
# ---
# name: test_sensor_snapshot[sensor.test_mower_2_error-entry]
# name: test_sensor_snapshot[sensor.garden_test_mower_2_error-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
@@ -1784,7 +1784,7 @@
'disabled_by': None,
'domain': 'sensor',
'entity_category': None,
'entity_id': 'sensor.test_mower_2_error',
'entity_id': 'sensor.garden_test_mower_2_error',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -1807,7 +1807,7 @@
'unit_of_measurement': None,
})
# ---
# name: test_sensor_snapshot[sensor.test_mower_2_error-state]
# name: test_sensor_snapshot[sensor.garden_test_mower_2_error-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'enum',
@@ -1946,14 +1946,14 @@
]),
}),
'context': <ANY>,
'entity_id': 'sensor.test_mower_2_error',
'entity_id': 'sensor.garden_test_mower_2_error',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'no_error',
})
# ---
# name: test_sensor_snapshot[sensor.test_mower_2_mode-entry]
# name: test_sensor_snapshot[sensor.garden_test_mower_2_mode-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
@@ -1976,7 +1976,7 @@
'disabled_by': None,
'domain': 'sensor',
'entity_category': None,
'entity_id': 'sensor.test_mower_2_mode',
'entity_id': 'sensor.garden_test_mower_2_mode',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -1999,7 +1999,7 @@
'unit_of_measurement': None,
})
# ---
# name: test_sensor_snapshot[sensor.test_mower_2_mode-state]
# name: test_sensor_snapshot[sensor.garden_test_mower_2_mode-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'enum',
@@ -2014,14 +2014,14 @@
]),
}),
'context': <ANY>,
'entity_id': 'sensor.test_mower_2_mode',
'entity_id': 'sensor.garden_test_mower_2_mode',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'main_area',
})
# ---
# name: test_sensor_snapshot[sensor.test_mower_2_next_start-entry]
# name: test_sensor_snapshot[sensor.garden_test_mower_2_next_start-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
@@ -2035,7 +2035,7 @@
'disabled_by': None,
'domain': 'sensor',
'entity_category': None,
'entity_id': 'sensor.test_mower_2_next_start',
'entity_id': 'sensor.garden_test_mower_2_next_start',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -2058,21 +2058,21 @@
'unit_of_measurement': None,
})
# ---
# name: test_sensor_snapshot[sensor.test_mower_2_next_start-state]
# name: test_sensor_snapshot[sensor.garden_test_mower_2_next_start-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'timestamp',
'friendly_name': 'Test Mower 2 Next start',
}),
'context': <ANY>,
'entity_id': 'sensor.test_mower_2_next_start',
'entity_id': 'sensor.garden_test_mower_2_next_start',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': '2023-06-05T17:00:00+00:00',
})
# ---
# name: test_sensor_snapshot[sensor.test_mower_2_remaining_charging_time-entry]
# name: test_sensor_snapshot[sensor.garden_test_mower_2_remaining_charging_time-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
@@ -2086,7 +2086,7 @@
'disabled_by': None,
'domain': 'sensor',
'entity_category': None,
'entity_id': 'sensor.test_mower_2_remaining_charging_time',
'entity_id': 'sensor.garden_test_mower_2_remaining_charging_time',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -2115,7 +2115,7 @@
'unit_of_measurement': <UnitOfTime.MINUTES: 'min'>,
})
# ---
# name: test_sensor_snapshot[sensor.test_mower_2_remaining_charging_time-state]
# name: test_sensor_snapshot[sensor.garden_test_mower_2_remaining_charging_time-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'duration',
@@ -2123,14 +2123,14 @@
'unit_of_measurement': <UnitOfTime.MINUTES: 'min'>,
}),
'context': <ANY>,
'entity_id': 'sensor.test_mower_2_remaining_charging_time',
'entity_id': 'sensor.garden_test_mower_2_remaining_charging_time',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'unavailable',
})
# ---
# name: test_sensor_snapshot[sensor.test_mower_2_restricted_reason-entry]
# name: test_sensor_snapshot[sensor.garden_test_mower_2_restricted_reason-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
@@ -2169,7 +2169,7 @@
'disabled_by': None,
'domain': 'sensor',
'entity_category': None,
'entity_id': 'sensor.test_mower_2_restricted_reason',
'entity_id': 'sensor.garden_test_mower_2_restricted_reason',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -2192,7 +2192,7 @@
'unit_of_measurement': None,
})
# ---
# name: test_sensor_snapshot[sensor.test_mower_2_restricted_reason-state]
# name: test_sensor_snapshot[sensor.garden_test_mower_2_restricted_reason-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'enum',
@@ -2223,7 +2223,7 @@
]),
}),
'context': <ANY>,
'entity_id': 'sensor.test_mower_2_restricted_reason',
'entity_id': 'sensor.garden_test_mower_2_restricted_reason',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
@@ -1,5 +1,5 @@
# serializer version: 1
# name: test_switch_snapshot[switch.test_mower_1_avoid_danger_zone-entry]
# name: test_switch_snapshot[switch.garden_test_mower_1_avoid_danger_zone-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
@@ -13,7 +13,7 @@
'disabled_by': None,
'domain': 'switch',
'entity_category': None,
'entity_id': 'switch.test_mower_1_avoid_danger_zone',
'entity_id': 'switch.garden_test_mower_1_avoid_danger_zone',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -36,20 +36,20 @@
'unit_of_measurement': None,
})
# ---
# name: test_switch_snapshot[switch.test_mower_1_avoid_danger_zone-state]
# name: test_switch_snapshot[switch.garden_test_mower_1_avoid_danger_zone-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'friendly_name': 'Test Mower 1 Avoid Danger Zone',
}),
'context': <ANY>,
'entity_id': 'switch.test_mower_1_avoid_danger_zone',
'entity_id': 'switch.garden_test_mower_1_avoid_danger_zone',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'off',
})
# ---
# name: test_switch_snapshot[switch.test_mower_1_avoid_springflowers-entry]
# name: test_switch_snapshot[switch.garden_test_mower_1_avoid_springflowers-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
@@ -63,7 +63,7 @@
'disabled_by': None,
'domain': 'switch',
'entity_category': None,
'entity_id': 'switch.test_mower_1_avoid_springflowers',
'entity_id': 'switch.garden_test_mower_1_avoid_springflowers',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -86,20 +86,20 @@
'unit_of_measurement': None,
})
# ---
# name: test_switch_snapshot[switch.test_mower_1_avoid_springflowers-state]
# name: test_switch_snapshot[switch.garden_test_mower_1_avoid_springflowers-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'friendly_name': 'Test Mower 1 Avoid Springflowers',
}),
'context': <ANY>,
'entity_id': 'switch.test_mower_1_avoid_springflowers',
'entity_id': 'switch.garden_test_mower_1_avoid_springflowers',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'on',
})
# ---
# name: test_switch_snapshot[switch.test_mower_1_back_lawn-entry]
# name: test_switch_snapshot[switch.garden_test_mower_1_back_lawn-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
@@ -113,7 +113,7 @@
'disabled_by': None,
'domain': 'switch',
'entity_category': None,
'entity_id': 'switch.test_mower_1_back_lawn',
'entity_id': 'switch.garden_test_mower_1_back_lawn',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -136,20 +136,20 @@
'unit_of_measurement': None,
})
# ---
# name: test_switch_snapshot[switch.test_mower_1_back_lawn-state]
# name: test_switch_snapshot[switch.garden_test_mower_1_back_lawn-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'friendly_name': 'Test Mower 1 Back lawn',
}),
'context': <ANY>,
'entity_id': 'switch.test_mower_1_back_lawn',
'entity_id': 'switch.garden_test_mower_1_back_lawn',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'on',
})
# ---
# name: test_switch_snapshot[switch.test_mower_1_enable_schedule-entry]
# name: test_switch_snapshot[switch.garden_test_mower_1_enable_schedule-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
@@ -163,7 +163,7 @@
'disabled_by': None,
'domain': 'switch',
'entity_category': None,
'entity_id': 'switch.test_mower_1_enable_schedule',
'entity_id': 'switch.garden_test_mower_1_enable_schedule',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -186,20 +186,20 @@
'unit_of_measurement': None,
})
# ---
# name: test_switch_snapshot[switch.test_mower_1_enable_schedule-state]
# name: test_switch_snapshot[switch.garden_test_mower_1_enable_schedule-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'friendly_name': 'Test Mower 1 Enable schedule',
}),
'context': <ANY>,
'entity_id': 'switch.test_mower_1_enable_schedule',
'entity_id': 'switch.garden_test_mower_1_enable_schedule',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'on',
})
# ---
# name: test_switch_snapshot[switch.test_mower_1_front_lawn-entry]
# name: test_switch_snapshot[switch.garden_test_mower_1_front_lawn-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
@@ -213,7 +213,7 @@
'disabled_by': None,
'domain': 'switch',
'entity_category': None,
'entity_id': 'switch.test_mower_1_front_lawn',
'entity_id': 'switch.garden_test_mower_1_front_lawn',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -236,20 +236,20 @@
'unit_of_measurement': None,
})
# ---
# name: test_switch_snapshot[switch.test_mower_1_front_lawn-state]
# name: test_switch_snapshot[switch.garden_test_mower_1_front_lawn-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'friendly_name': 'Test Mower 1 Front lawn',
}),
'context': <ANY>,
'entity_id': 'switch.test_mower_1_front_lawn',
'entity_id': 'switch.garden_test_mower_1_front_lawn',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'on',
})
# ---
# name: test_switch_snapshot[switch.test_mower_1_my_lawn-entry]
# name: test_switch_snapshot[switch.garden_test_mower_1_my_lawn-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
@@ -263,7 +263,7 @@
'disabled_by': None,
'domain': 'switch',
'entity_category': None,
'entity_id': 'switch.test_mower_1_my_lawn',
'entity_id': 'switch.garden_test_mower_1_my_lawn',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -286,20 +286,20 @@
'unit_of_measurement': None,
})
# ---
# name: test_switch_snapshot[switch.test_mower_1_my_lawn-state]
# name: test_switch_snapshot[switch.garden_test_mower_1_my_lawn-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'friendly_name': 'Test Mower 1 My lawn',
}),
'context': <ANY>,
'entity_id': 'switch.test_mower_1_my_lawn',
'entity_id': 'switch.garden_test_mower_1_my_lawn',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'off',
})
# ---
# name: test_switch_snapshot[switch.test_mower_2_enable_schedule-entry]
# name: test_switch_snapshot[switch.garden_test_mower_2_enable_schedule-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
@@ -313,7 +313,7 @@
'disabled_by': None,
'domain': 'switch',
'entity_category': None,
'entity_id': 'switch.test_mower_2_enable_schedule',
'entity_id': 'switch.garden_test_mower_2_enable_schedule',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -336,13 +336,13 @@
'unit_of_measurement': None,
})
# ---
# name: test_switch_snapshot[switch.test_mower_2_enable_schedule-state]
# name: test_switch_snapshot[switch.garden_test_mower_2_enable_schedule-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'friendly_name': 'Test Mower 2 Enable schedule',
}),
'context': <ANY>,
'entity_id': 'switch.test_mower_2_enable_schedule',
'entity_id': 'switch.garden_test_mower_2_enable_schedule',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
@@ -36,7 +36,7 @@ async def test_button_error_confirm(
values: dict[str, MowerAttributes],
) -> None:
"""Test error confirm button command."""
entity_id = "button.test_mower_1_confirm_error"
entity_id = "button.garden_test_mower_1_confirm_error"
await setup_integration(hass, mock_config_entry)
state = hass.states.get(entity_id)
assert state.name == "Test Mower 1 Confirm error"
@@ -63,17 +63,17 @@ async def test_button_error_confirm(
("entity_id", "name", "expected_command"),
[
(
"button.test_mower_1_confirm_error",
"button.garden_test_mower_1_confirm_error",
"Test Mower 1 Confirm error",
"error_confirm",
),
(
"button.test_mower_1_sync_clock",
"button.garden_test_mower_1_sync_clock",
"Test Mower 1 Sync clock",
"set_datetime",
),
(
"button.test_mower_1_reset_cutting_blade_usage_time",
"button.garden_test_mower_1_reset_cutting_blade_usage_time",
"Test Mower 1 Reset cutting blade usage time",
"reset_cutting_blade_usage_time",
),
@@ -34,7 +34,7 @@ from tests.common import (
)
from tests.typing import ClientSessionGenerator
TEST_ENTITY = "calendar.test_mower_1"
TEST_ENTITY = "calendar.garden_test_mower_1"
type GetEventsFn = Callable[[str, str], Awaitable[dict[str, Any]]]
@@ -66,7 +66,7 @@ async def test_calendar_state_off(
) -> None:
"""State test of the calendar."""
await setup_integration(hass, mock_config_entry)
state = hass.states.get("calendar.test_mower_1")
state = hass.states.get("calendar.garden_test_mower_1")
assert state is not None
assert state.state == "off"
@@ -81,7 +81,7 @@ async def test_calendar_state_on(
) -> None:
"""State test of the calendar."""
await setup_integration(hass, mock_config_entry)
state = hass.states.get("calendar.test_mower_1")
state = hass.states.get("calendar.garden_test_mower_1")
assert state is not None
assert state.state == "on"
@@ -108,7 +108,7 @@ async def test_empty_calendar(
freezer.tick(SCAN_INTERVAL)
async_fire_time_changed(hass)
await hass.async_block_till_done()
state = hass.states.get("calendar.test_mower_1")
state = hass.states.get("calendar.garden_test_mower_1")
assert state is not None
assert state.state == "off"
events = await get_events("2023-06-05T00:00:00", "2023-06-12T00:00:00")
@@ -143,7 +143,10 @@ async def test_calendar_snapshot(
CALENDAR_DOMAIN,
SERVICE_GET_EVENTS,
{
ATTR_ENTITY_ID: ["calendar.test_mower_1", "calendar.test_mower_2"],
ATTR_ENTITY_ID: [
"calendar.garden_test_mower_1",
"calendar.garden_test_mower_2",
],
EVENT_START_DATETIME: start_date,
EVENT_END_DATETIME: end_date,
},
@@ -62,7 +62,7 @@ async def test_event(
assert mock_automower_client.register_single_message_callback.called
# Check initial state (event entity not available yet)
state = hass.states.get("event.test_mower_1_message")
state = hass.states.get("event.garden_test_mower_1_message")
assert state is None
# Simulate a new message for this mower and check entity creation
@@ -84,7 +84,7 @@ async def test_event(
cb(message)
await hass.async_block_till_done()
state = hass.states.get("event.test_mower_1_message")
state = hass.states.get("event.garden_test_mower_1_message")
assert state is not None
assert state.attributes[ATTR_EVENT_TYPE] == "wheel_motor_overloaded_rear_left"
@@ -98,7 +98,7 @@ async def test_event(
cb()
await hass.async_block_till_done()
state = hass.states.get("event.test_mower_1_message")
state = hass.states.get("event.garden_test_mower_1_message")
assert state is not None
assert state.attributes[ATTR_EVENT_TYPE] == "wheel_motor_overloaded_rear_left"
@@ -120,7 +120,7 @@ async def test_event(
for cb in callbacks:
cb(message)
await hass.async_block_till_done()
state = hass.states.get("event.test_mower_1_message")
state = hass.states.get("event.garden_test_mower_1_message")
assert state is not None
assert state.attributes[ATTR_EVENT_TYPE] == "alarm_mower_lifted"
@@ -144,10 +144,10 @@ async def test_event(
cb(message)
await hass.async_block_till_done()
entry = entity_registry.async_get("event.test_mower_1_message")
entry = entity_registry.async_get("event.garden_test_mower_1_message")
assert entry is not None
assert state.attributes[ATTR_EVENT_TYPE] == "alarm_mower_lifted"
state = hass.states.get("event.test_mower_2_message")
state = hass.states.get("event.garden_test_mower_2_message")
assert state is not None
assert state.attributes[ATTR_EVENT_TYPE] == "battery_problem"
@@ -158,9 +158,9 @@ async def test_event(
freezer.tick(SCAN_INTERVAL)
async_fire_time_changed(hass)
await hass.async_block_till_done()
state = hass.states.get("event.test_mower_2_message")
state = hass.states.get("event.garden_test_mower_2_message")
assert state is None
entry = entity_registry.async_get("event.test_mower_2_message")
entry = entity_registry.async_get("event.garden_test_mower_2_message")
assert entry is None
@@ -290,10 +290,10 @@ async def test_constant_polling(
assert mock_automower_client.register_data_callback.called
assert "cb" in callback_holder
state = hass.states.get("sensor.test_mower_1_battery")
state = hass.states.get("sensor.garden_test_mower_1_battery")
assert state is not None
assert state.state == "100"
state = hass.states.get("sensor.test_mower_1_front_lawn_progress")
state = hass.states.get("sensor.garden_test_mower_1_front_lawn_progress")
assert state is not None
assert state.state == "40"
@@ -306,10 +306,10 @@ async def test_constant_polling(
callback_holder["cb"](test_values)
await hass.async_block_till_done()
state = hass.states.get("sensor.test_mower_1_battery")
state = hass.states.get("sensor.garden_test_mower_1_battery")
assert state is not None
assert state.state == "77"
state = hass.states.get("sensor.test_mower_1_front_lawn_progress")
state = hass.states.get("sensor.garden_test_mower_1_front_lawn_progress")
assert state is not None
assert state.state == "40"
@@ -319,10 +319,10 @@ async def test_constant_polling(
async_fire_time_changed(hass)
await hass.async_block_till_done()
mock_automower_client.get_status.assert_awaited()
state = hass.states.get("sensor.test_mower_1_battery")
state = hass.states.get("sensor.garden_test_mower_1_battery")
assert state is not None
assert state.state == "77"
state = hass.states.get("sensor.test_mower_1_front_lawn_progress")
state = hass.states.get("sensor.garden_test_mower_1_front_lawn_progress")
assert state is not None
assert state.state == "50"
@@ -481,7 +481,7 @@ async def test_add_and_remove_work_area(
await hass.async_block_till_done()
assert mock_automower_client.get_status.called
state = hass.states.get("sensor.test_mower_1_new_work_area_progress")
state = hass.states.get("sensor.garden_test_mower_1_new_work_area_progress")
assert state is not None
assert state.state == "12"
current_entites_after_addition = len(
@@ -61,7 +61,7 @@ async def test_lawn_mower_states(
) -> None:
"""Test lawn_mower state."""
await setup_integration(hass, mock_config_entry)
state = hass.states.get("lawn_mower.test_mower_1")
state = hass.states.get("lawn_mower.garden_test_mower_1")
assert state is not None
assert state.state == LawnMowerActivity.DOCKED
values[TEST_MOWER_ID].mower.activity = activity
@@ -70,7 +70,7 @@ async def test_lawn_mower_states(
freezer.tick(SCAN_INTERVAL)
async_fire_time_changed(hass)
await hass.async_block_till_done()
state = hass.states.get("lawn_mower.test_mower_1")
state = hass.states.get("lawn_mower.garden_test_mower_1")
assert state.state == expected_state
@@ -94,7 +94,7 @@ async def test_lawn_mower_commands(
await hass.services.async_call(
domain="lawn_mower",
service=service,
service_data={"entity_id": "lawn_mower.test_mower_1"},
service_data={"entity_id": "lawn_mower.garden_test_mower_1"},
blocking=True,
)
mocked_method = getattr(mock_automower_client.commands, aioautomower_command)
@@ -108,7 +108,7 @@ async def test_lawn_mower_commands(
await hass.services.async_call(
domain="lawn_mower",
service=service,
target={"entity_id": "lawn_mower.test_mower_1"},
target={"entity_id": "lawn_mower.garden_test_mower_1"},
blocking=True,
)
@@ -151,7 +151,7 @@ async def test_lawn_mower_service_commands(
await hass.services.async_call(
domain=DOMAIN,
service=service,
target={"entity_id": "lawn_mower.test_mower_1"},
target={"entity_id": "lawn_mower.garden_test_mower_1"},
service_data=service_data,
blocking=True,
)
@@ -165,7 +165,7 @@ async def test_lawn_mower_service_commands(
await hass.services.async_call(
domain=DOMAIN,
service=service,
target={"entity_id": "lawn_mower.test_mower_1"},
target={"entity_id": "lawn_mower.garden_test_mower_1"},
service_data=service_data,
blocking=True,
)
@@ -202,7 +202,7 @@ async def test_lawn_mower_override_work_area_command(
await hass.services.async_call(
domain=DOMAIN,
service=service,
target={"entity_id": "lawn_mower.test_mower_1"},
target={"entity_id": "lawn_mower.garden_test_mower_1"},
service_data=service_data,
blocking=True,
)
@@ -218,7 +218,7 @@ async def test_lawn_mower_override_work_area_command(
await hass.services.async_call(
domain=DOMAIN,
service=service,
target={"entity_id": "lawn_mower.test_mower_1"},
target={"entity_id": "lawn_mower.garden_test_mower_1"},
service_data=service_data,
blocking=True,
)
@@ -278,7 +278,7 @@ async def test_lawn_mower_wrong_service_commands(
await hass.services.async_call(
domain=DOMAIN,
service=service,
target={"entity_id": "lawn_mower.test_mower_1"},
target={"entity_id": "lawn_mower.garden_test_mower_1"},
service_data=service_data,
blocking=True,
)
@@ -28,7 +28,7 @@ async def test_number_commands(
mock_config_entry: MockConfigEntry,
) -> None:
"""Test number commands."""
entity_id = "number.test_mower_1_cutting_height"
entity_id = "number.garden_test_mower_1_cutting_height"
await setup_integration(hass, mock_config_entry)
await hass.services.async_call(
domain="number",
@@ -63,7 +63,7 @@ async def test_number_workarea_commands(
values: dict[str, MowerAttributes],
) -> None:
"""Test number commands."""
entity_id = "number.test_mower_1_front_lawn_cutting_height"
entity_id = "number.garden_test_mower_1_front_lawn_cutting_height"
await setup_integration(hass, mock_config_entry)
values[TEST_MOWER_ID].work_areas[123456].cutting_height = 75
mock_automower_client.get_status.return_value = values
@@ -26,7 +26,7 @@ async def test_select_states(
) -> None:
"""Test states of headlight mode select."""
await setup_integration(hass, mock_config_entry)
state = hass.states.get("select.test_mower_1_headlight_mode")
state = hass.states.get("select.garden_test_mower_1_headlight_mode")
assert state is not None
assert state.state == "evening_only"
@@ -43,7 +43,7 @@ async def test_select_states(
freezer.tick(SCAN_INTERVAL)
async_fire_time_changed(hass)
await hass.async_block_till_done()
state = hass.states.get("select.test_mower_1_headlight_mode")
state = hass.states.get("select.garden_test_mower_1_headlight_mode")
assert state.state == expected_state
@@ -68,7 +68,7 @@ async def test_select_commands(
domain="select",
service="select_option",
service_data={
"entity_id": "select.test_mower_1_headlight_mode",
"entity_id": "select.garden_test_mower_1_headlight_mode",
"option": service,
},
blocking=True,
@@ -86,7 +86,7 @@ async def test_select_commands(
domain="select",
service="select_option",
service_data={
"entity_id": "select.test_mower_1_headlight_mode",
"entity_id": "select.garden_test_mower_1_headlight_mode",
"option": service,
},
blocking=True,
@@ -35,7 +35,7 @@ async def test_sensor_unknown_states(
) -> None:
"""Test a sensor which returns unknown."""
await setup_integration(hass, mock_config_entry)
state = hass.states.get("sensor.test_mower_1_mode")
state = hass.states.get("sensor.garden_test_mower_1_mode")
assert state is not None
assert state.state == "main_area"
@@ -44,7 +44,7 @@ async def test_sensor_unknown_states(
freezer.tick(SCAN_INTERVAL)
async_fire_time_changed(hass)
await hass.async_block_till_done()
state = hass.states.get("sensor.test_mower_1_mode")
state = hass.states.get("sensor.garden_test_mower_1_mode")
assert state.state == STATE_UNAVAILABLE
@@ -57,7 +57,7 @@ async def test_cutting_blade_usage_time_sensor(
"""Test if this sensor is only added, if data is available."""
await setup_integration(hass, mock_config_entry)
state = hass.states.get("sensor.test_mower_1_cutting_blade_usage_time")
state = hass.states.get("sensor.garden_test_mower_1_cutting_blade_usage_time")
assert state is not None
assert float(state.state) == pytest.approx(0.03416666)
@@ -74,7 +74,7 @@ async def test_next_start_sensor(
) -> None:
"""Test if this sensor is only added, if data is available."""
await setup_integration(hass, mock_config_entry)
state = hass.states.get("sensor.test_mower_1_next_start")
state = hass.states.get("sensor.garden_test_mower_1_next_start")
assert state is not None
assert state.state == "2023-06-05T17:00:00+00:00"
@@ -83,7 +83,7 @@ async def test_next_start_sensor(
freezer.tick(SCAN_INTERVAL)
async_fire_time_changed(hass)
await hass.async_block_till_done()
state = hass.states.get("sensor.test_mower_1_next_start")
state = hass.states.get("sensor.garden_test_mower_1_next_start")
assert state.state == STATE_UNAVAILABLE
@@ -96,7 +96,7 @@ async def test_work_area_sensor(
) -> None:
"""Test the work area sensor."""
await setup_integration(hass, mock_config_entry)
state = hass.states.get("sensor.test_mower_1_work_area")
state = hass.states.get("sensor.garden_test_mower_1_work_area")
assert state is not None
assert state.state == "Front lawn"
@@ -105,7 +105,7 @@ async def test_work_area_sensor(
freezer.tick(SCAN_INTERVAL)
async_fire_time_changed(hass)
await hass.async_block_till_done()
state = hass.states.get("sensor.test_mower_1_work_area")
state = hass.states.get("sensor.garden_test_mower_1_work_area")
assert state.state == "no_work_area_active"
values[TEST_MOWER_ID].mower.work_area_id = 0
@@ -113,7 +113,7 @@ async def test_work_area_sensor(
freezer.tick(SCAN_INTERVAL)
async_fire_time_changed(hass)
await hass.async_block_till_done()
state = hass.states.get("sensor.test_mower_1_work_area")
state = hass.states.get("sensor.garden_test_mower_1_work_area")
assert state.state == "my_lawn"
# Test EPOS mower, which returns work_area_id = 0, when no
@@ -125,7 +125,7 @@ async def test_work_area_sensor(
freezer.tick(SCAN_INTERVAL)
async_fire_time_changed(hass)
await hass.async_block_till_done()
state = hass.states.get("sensor.test_mower_1_work_area")
state = hass.states.get("sensor.garden_test_mower_1_work_area")
assert state.state == "no_work_area_active"
@@ -137,7 +137,7 @@ async def test_restricted_reason_sensor(
values: dict[str, MowerAttributes],
) -> None:
"""Test the work area sensor."""
sensor = "sensor.test_mower_1_restricted_reason"
sensor = "sensor.garden_test_mower_1_restricted_reason"
await setup_integration(hass, mock_config_entry)
state = hass.states.get(sensor)
assert state is not None
@@ -190,7 +190,7 @@ async def test_statistics_not_available(
delattr(values[TEST_MOWER_ID].statistics, sensor_to_test)
mock_automower_client.get_status.return_value = values
await setup_integration(hass, mock_config_entry)
state = hass.states.get(f"sensor.test_mower_1_{sensor_to_test}")
state = hass.states.get(f"sensor.garden_test_mower_1_{sensor_to_test}")
assert state is None
@@ -217,7 +217,7 @@ async def test_error_sensor(
freezer.tick(SCAN_INTERVAL)
async_fire_time_changed(hass)
await hass.async_block_till_done()
state = hass.states.get("sensor.test_mower_1_error")
state = hass.states.get("sensor.garden_test_mower_1_error")
assert state.state == expected_state
@@ -62,7 +62,7 @@ async def test_switch_states(
freezer.tick(SCAN_INTERVAL)
async_fire_time_changed(hass)
await hass.async_block_till_done()
state = hass.states.get("switch.test_mower_1_enable_schedule")
state = hass.states.get("switch.garden_test_mower_1_enable_schedule")
assert state.state == expected_state
@@ -86,7 +86,7 @@ async def test_switch_commands(
await hass.services.async_call(
domain=SWITCH_DOMAIN,
service=service,
service_data={ATTR_ENTITY_ID: "switch.test_mower_1_enable_schedule"},
service_data={ATTR_ENTITY_ID: "switch.garden_test_mower_1_enable_schedule"},
blocking=True,
)
mocked_method = getattr(mock_automower_client.commands, aioautomower_command)
@@ -100,7 +100,7 @@ async def test_switch_commands(
await hass.services.async_call(
domain=SWITCH_DOMAIN,
service=service,
service_data={ATTR_ENTITY_ID: "switch.test_mower_1_enable_schedule"},
service_data={ATTR_ENTITY_ID: "switch.garden_test_mower_1_enable_schedule"},
blocking=True,
)
assert len(mocked_method.mock_calls) == 2
@@ -125,7 +125,7 @@ async def test_stay_out_zone_switch_commands(
mower_time_zone: zoneinfo.ZoneInfo,
) -> None:
"""Test switch commands."""
entity_id = "switch.test_mower_1_avoid_danger_zone"
entity_id = "switch.garden_test_mower_1_avoid_danger_zone"
await setup_integration(hass, mock_config_entry)
values = mower_list_to_dictionary_dataclass(
load_json_value_fixture("mower.json", DOMAIN),
@@ -182,7 +182,7 @@ async def test_work_area_switch_commands(
values: dict[str, MowerAttributes],
) -> None:
"""Test switch commands."""
entity_id = "switch.test_mower_1_my_lawn"
entity_id = "switch.garden_test_mower_1_my_lawn"
await setup_integration(hass, mock_config_entry)
values = mower_list_to_dictionary_dataclass(
load_json_value_fixture("mower.json", DOMAIN),
@@ -1,5 +1,5 @@
# serializer version: 1
# name: test_setup[sensor.husqvarna_automower_battery-entry]
# name: test_setup[sensor.garden_husqvarna_automower_battery-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
@@ -15,7 +15,7 @@
'disabled_by': None,
'domain': 'sensor',
'entity_category': <EntityCategory.DIAGNOSTIC: 'diagnostic'>,
'entity_id': 'sensor.husqvarna_automower_battery',
'entity_id': 'sensor.garden_husqvarna_automower_battery',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -38,7 +38,7 @@
'unit_of_measurement': '%',
})
# ---
# name: test_setup[sensor.husqvarna_automower_battery-state]
# name: test_setup[sensor.garden_husqvarna_automower_battery-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'battery',
@@ -47,7 +47,7 @@
'unit_of_measurement': '%',
}),
'context': <ANY>,
'entity_id': 'sensor.husqvarna_automower_battery',
'entity_id': 'sensor.garden_husqvarna_automower_battery',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
@@ -50,7 +50,10 @@ async def test_setup_disconnect(
assert mock_config_entry.state is ConfigEntryState.LOADED
assert hass.states.get("lawn_mower.husqvarna_automower").state != STATE_UNAVAILABLE
assert (
hass.states.get("lawn_mower.garden_husqvarna_automower").state
!= STATE_UNAVAILABLE
)
mock_automower_client.is_connected.side_effect = is_connected_side_effect
mock_automower_client.is_connected.return_value = is_connected_return_value
@@ -61,7 +64,10 @@ async def test_setup_disconnect(
async_fire_time_changed(hass)
await hass.async_block_till_done()
assert hass.states.get("lawn_mower.husqvarna_automower").state == STATE_UNAVAILABLE
assert (
hass.states.get("lawn_mower.garden_husqvarna_automower").state
== STATE_UNAVAILABLE
)
@pytest.mark.parametrize(
@@ -93,7 +99,10 @@ async def test_invalid_data_received(
async_fire_time_changed(hass)
await hass.async_block_till_done()
assert hass.states.get("lawn_mower.husqvarna_automower").state == STATE_UNAVAILABLE
assert (
hass.states.get("lawn_mower.garden_husqvarna_automower").state
== STATE_UNAVAILABLE
)
@pytest.mark.parametrize(
@@ -125,7 +134,10 @@ async def test_bleak_error_data_update(
async_fire_time_changed(hass)
await hass.async_block_till_done()
assert hass.states.get("lawn_mower.husqvarna_automower").state == STATE_UNAVAILABLE
assert (
hass.states.get("lawn_mower.garden_husqvarna_automower").state
== STATE_UNAVAILABLE
)
OPERATIONAL_STATES = [
@@ -214,6 +226,6 @@ async def test_mower_activity_mapping(
await hass.async_block_till_done()
assert (
hass.states.get("lawn_mower.husqvarna_automower").state
hass.states.get("lawn_mower.garden_husqvarna_automower").state
== expected_state
)
@@ -26,7 +26,7 @@ from homeassistant.helpers import device_registry as dr
from . import MOCK_SERIAL
ENTITY_ID = f"media_player.kaleidescape_device_{MOCK_SERIAL}"
ENTITY_ID = f"media_player.theater_kaleidescape_device_{MOCK_SERIAL}"
FRIENDLY_NAME = f"Kaleidescape Device {MOCK_SERIAL}"
+1 -1
View File
@@ -15,7 +15,7 @@ from homeassistant.exceptions import HomeAssistantError
from . import MOCK_SERIAL
ENTITY_ID = f"remote.kaleidescape_device_{MOCK_SERIAL}"
ENTITY_ID = f"remote.theater_kaleidescape_device_{MOCK_SERIAL}"
@pytest.mark.usefixtures("mock_device", "mock_integration")
+1 -1
View File
@@ -11,7 +11,7 @@ from homeassistant.helpers import entity_registry as er
from . import MOCK_SERIAL
ENTITY_ID = f"sensor.kaleidescape_device_{MOCK_SERIAL}"
ENTITY_ID = f"sensor.theater_kaleidescape_device_{MOCK_SERIAL}"
FRIENDLY_NAME = f"Kaleidescape Device {MOCK_SERIAL}"
+1 -1
View File
@@ -53,7 +53,7 @@ async def test_hev_cycle_state(
await async_setup_component(hass, lifx.DOMAIN, {lifx.DOMAIN: {}})
await hass.async_block_till_done()
entity_id = "binary_sensor.my_bulb_clean_cycle"
entity_id = "binary_sensor.my_group_my_bulb_clean_cycle"
state = hass.states.get(entity_id)
assert state
+2 -2
View File
@@ -53,7 +53,7 @@ async def test_button_restart(
await hass.async_block_till_done()
unique_id = f"{SERIAL}_restart"
entity_id = "button.my_bulb_restart"
entity_id = "button.my_group_my_bulb_restart"
entity = entity_registry.async_get(entity_id)
assert entity
@@ -88,7 +88,7 @@ async def test_button_identify(
await hass.async_block_till_done()
unique_id = f"{SERIAL}_identify"
entity_id = "button.my_bulb_identify"
entity_id = "button.my_group_my_bulb_identify"
entity = entity_registry.async_get(entity_id)
assert entity
+1 -1
View File
@@ -640,7 +640,7 @@ async def test_suggested_area(
await async_setup_component(hass, DOMAIN, {DOMAIN: {}})
await hass.async_block_till_done()
entity_id = "light.my_bulb"
entity_id = "light.my_lifx_group_my_bulb"
entity = entity_registry.async_get(entity_id)
device = device_registry.async_get(entity.device_id)
+25 -25
View File
@@ -107,7 +107,7 @@ async def test_light_unique_id(
await async_setup_component(hass, lifx.DOMAIN, {lifx.DOMAIN: {}})
await hass.async_block_till_done()
entity_id = "light.my_bulb"
entity_id = "light.my_group_my_bulb"
assert entity_registry.async_get(entity_id).unique_id == SERIAL
device = device_registry.async_get_device(
@@ -135,7 +135,7 @@ async def test_light_unique_id_new_firmware(
await async_setup_component(hass, lifx.DOMAIN, {lifx.DOMAIN: {}})
await hass.async_block_till_done()
entity_id = "light.my_bulb"
entity_id = "light.my_group_my_bulb"
assert entity_registry.async_get(entity_id).unique_id == SERIAL
device = device_registry.async_get_device(
connections={(dr.CONNECTION_NETWORK_MAC, MAC_ADDRESS)},
@@ -160,7 +160,7 @@ async def test_light_strip(hass: HomeAssistant) -> None:
await async_setup_component(hass, lifx.DOMAIN, {lifx.DOMAIN: {}})
await hass.async_block_till_done()
entity_id = "light.my_bulb"
entity_id = "light.my_group_my_bulb"
state = hass.states.get(entity_id)
assert state.state == "on"
@@ -460,7 +460,7 @@ async def test_extended_multizone_messages(hass: HomeAssistant) -> None:
await async_setup_component(hass, lifx.DOMAIN, {lifx.DOMAIN: {}})
await hass.async_block_till_done()
entity_id = "light.my_bulb"
entity_id = "light.my_group_my_bulb"
state = hass.states.get(entity_id)
assert state.state == "on"
@@ -697,7 +697,7 @@ async def test_matrix_flame_morph_effects(hass: HomeAssistant) -> None:
await async_setup_component(hass, lifx.DOMAIN, {lifx.DOMAIN: {}})
await hass.async_block_till_done()
entity_id = "light.my_bulb"
entity_id = "light.my_group_my_bulb"
# FLAME effect test
await hass.services.async_call(
@@ -851,7 +851,7 @@ async def test_sky_effect(hass: HomeAssistant) -> None:
await async_setup_component(hass, lifx.DOMAIN, {lifx.DOMAIN: {}})
await hass.async_block_till_done()
entity_id = "light.my_bulb"
entity_id = "light.my_group_my_bulb"
# SKY effect test
bulb.power_level = 0
@@ -983,7 +983,7 @@ async def test_lightstrip_move_effect(hass: HomeAssistant) -> None:
await async_setup_component(hass, lifx.DOMAIN, {lifx.DOMAIN: {}})
await hass.async_block_till_done()
entity_id = "light.my_bulb"
entity_id = "light.my_group_my_bulb"
await hass.services.async_call(
LIGHT_DOMAIN,
@@ -1081,7 +1081,7 @@ async def test_paint_theme_service(hass: HomeAssistant) -> None:
await async_setup_component(hass, lifx.DOMAIN, {lifx.DOMAIN: {}})
await hass.async_block_till_done()
entity_id = "light.my_bulb"
entity_id = "light.my_group_my_bulb"
bulb.power_level = 0
await hass.services.async_call(
@@ -1180,7 +1180,7 @@ async def test_color_light_with_temp(
await async_setup_component(hass, lifx.DOMAIN, {lifx.DOMAIN: {}})
await hass.async_block_till_done()
entity_id = "light.my_bulb"
entity_id = "light.my_group_my_bulb"
state = hass.states.get(entity_id)
assert state.state == "on"
@@ -1391,7 +1391,7 @@ async def test_white_bulb(hass: HomeAssistant) -> None:
await async_setup_component(hass, lifx.DOMAIN, {lifx.DOMAIN: {}})
await hass.async_block_till_done()
entity_id = "light.my_bulb"
entity_id = "light.my_group_my_bulb"
state = hass.states.get(entity_id)
assert state.state == "on"
@@ -1467,7 +1467,7 @@ async def test_config_zoned_light_strip_fails(
)
already_migrated_config_entry.add_to_hass(hass)
light_strip = _mocked_light_strip()
entity_id = "light.my_bulb"
entity_id = "light.my_group_my_bulb"
class MockFailingLifxCommand:
"""Mock a lifx command that fails on the 2nd try."""
@@ -1510,7 +1510,7 @@ async def test_legacy_zoned_light_strip(
)
already_migrated_config_entry.add_to_hass(hass)
light_strip = _mocked_light_strip()
entity_id = "light.my_bulb"
entity_id = "light.my_group_my_bulb"
class MockPopulateLifxZonesCommand:
"""Mock populating the number of zones."""
@@ -1563,7 +1563,7 @@ async def test_white_light_fails(
)
already_migrated_config_entry.add_to_hass(hass)
bulb = _mocked_white_bulb()
entity_id = "light.my_bulb"
entity_id = "light.my_group_my_bulb"
bulb.set_power = MockFailingLifxCommand(bulb)
@@ -1621,7 +1621,7 @@ async def test_brightness_bulb(hass: HomeAssistant) -> None:
await async_setup_component(hass, lifx.DOMAIN, {lifx.DOMAIN: {}})
await hass.async_block_till_done()
entity_id = "light.my_bulb"
entity_id = "light.my_group_my_bulb"
state = hass.states.get(entity_id)
assert state.state == "on"
@@ -1682,7 +1682,7 @@ async def test_transitions_brightness_only(hass: HomeAssistant) -> None:
await async_setup_component(hass, lifx.DOMAIN, {lifx.DOMAIN: {}})
await hass.async_block_till_done()
entity_id = "light.my_bulb"
entity_id = "light.my_group_my_bulb"
state = hass.states.get(entity_id)
assert state.state == "on"
@@ -1752,7 +1752,7 @@ async def test_transitions_color_bulb(hass: HomeAssistant) -> None:
await async_setup_component(hass, lifx.DOMAIN, {lifx.DOMAIN: {}})
await hass.async_block_till_done()
entity_id = "light.my_bulb"
entity_id = "light.my_group_my_bulb"
state = hass.states.get(entity_id)
assert state.state == "on"
@@ -1887,7 +1887,7 @@ async def test_lifx_set_state_brightness(hass: HomeAssistant) -> None:
await async_setup_component(hass, lifx.DOMAIN, {lifx.DOMAIN: {}})
await hass.async_block_till_done()
entity_id = "light.my_bulb"
entity_id = "light.my_group_my_bulb"
# brightness_step should convert from 8 bit to 16 bit
await hass.services.async_call(
@@ -1939,7 +1939,7 @@ async def test_lifx_set_state_color(hass: HomeAssistant) -> None:
await async_setup_component(hass, lifx.DOMAIN, {lifx.DOMAIN: {}})
await hass.async_block_till_done()
entity_id = "light.my_bulb"
entity_id = "light.my_group_my_bulb"
# brightness should convert from 8 to 16 bits
await hass.services.async_call(
@@ -2049,7 +2049,7 @@ async def test_lifx_set_state_kelvin(hass: HomeAssistant) -> None:
await async_setup_component(hass, lifx.DOMAIN, {lifx.DOMAIN: {}})
await hass.async_block_till_done()
entity_id = "light.my_bulb"
entity_id = "light.my_group_my_bulb"
state = hass.states.get(entity_id)
assert state.state == "on"
@@ -2094,7 +2094,7 @@ async def test_infrared_color_bulb(hass: HomeAssistant) -> None:
await async_setup_component(hass, lifx.DOMAIN, {lifx.DOMAIN: {}})
await hass.async_block_till_done()
entity_id = "light.my_bulb"
entity_id = "light.my_group_my_bulb"
state = hass.states.get(entity_id)
assert state.state == "on"
@@ -2137,7 +2137,7 @@ async def test_color_bulb_is_actually_off(hass: HomeAssistant) -> None:
await async_setup_component(hass, lifx.DOMAIN, {lifx.DOMAIN: {}})
await hass.async_block_till_done()
entity_id = "light.my_bulb"
entity_id = "light.my_group_my_bulb"
state = hass.states.get(entity_id)
assert state.state == "on"
@@ -2195,7 +2195,7 @@ async def test_clean_bulb(hass: HomeAssistant) -> None:
await async_setup_component(hass, lifx.DOMAIN, {lifx.DOMAIN: {}})
await hass.async_block_till_done()
entity_id = "light.my_bulb"
entity_id = "light.my_group_my_bulb"
state = hass.states.get(entity_id)
assert state.state == "off"
await hass.services.async_call(
@@ -2234,7 +2234,7 @@ async def test_set_color_timeout_raises_home_assistant_error(
await hass.services.async_call(
LIGHT_DOMAIN,
"turn_on",
{ATTR_ENTITY_ID: "light.my_bulb", ATTR_HS_COLOR: (10, 30)},
{ATTR_ENTITY_ID: "light.my_group_my_bulb", ATTR_HS_COLOR: (10, 30)},
blocking=True,
)
@@ -2255,7 +2255,7 @@ async def test_set_hev_cycle_state_fails_for_color_bulb(hass: HomeAssistant) ->
await async_setup_component(hass, lifx.DOMAIN, {lifx.DOMAIN: {}})
await hass.async_block_till_done()
entity_id = "light.my_bulb"
entity_id = "light.my_group_my_bulb"
state = hass.states.get(entity_id)
assert state.state == "off"
@@ -2315,7 +2315,7 @@ async def test_light_strip_zones_not_populated_yet(hass: HomeAssistant) -> None:
await async_setup_component(hass, lifx.DOMAIN, {lifx.DOMAIN: {}})
await hass.async_block_till_done()
entity_id = "light.my_bulb"
entity_id = "light.my_group_my_bulb"
# Make sure we at least try to fetch the first zone
# to ensure we populate the zones from the 503 response
assert len(bulb.get_color_zones.calls) == 3
+7 -7
View File
@@ -51,7 +51,7 @@ async def test_theme_select(
await async_setup_component(hass, lifx.DOMAIN, {lifx.DOMAIN: {}})
await hass.async_block_till_done()
entity_id = "select.my_bulb_theme"
entity_id = "select.my_group_my_bulb_theme"
entity = entity_registry.async_get(entity_id)
assert entity
@@ -90,7 +90,7 @@ async def test_infrared_brightness(
await hass.async_block_till_done()
unique_id = f"{SERIAL}_infrared_brightness"
entity_id = "select.my_bulb_infrared_brightness"
entity_id = "select.my_group_my_bulb_infrared_brightness"
entity = entity_registry.async_get(entity_id)
assert entity
@@ -121,7 +121,7 @@ async def test_set_infrared_brightness_25_percent(hass: HomeAssistant) -> None:
await async_setup_component(hass, lifx.DOMAIN, {lifx.DOMAIN: {}})
await hass.async_block_till_done()
entity_id = "select.my_bulb_infrared_brightness"
entity_id = "select.my_group_my_bulb_infrared_brightness"
await hass.services.async_call(
SELECT_DOMAIN,
@@ -163,7 +163,7 @@ async def test_set_infrared_brightness_50_percent(hass: HomeAssistant) -> None:
await async_setup_component(hass, lifx.DOMAIN, {lifx.DOMAIN: {}})
await hass.async_block_till_done()
entity_id = "select.my_bulb_infrared_brightness"
entity_id = "select.my_group_my_bulb_infrared_brightness"
await hass.services.async_call(
SELECT_DOMAIN,
@@ -205,7 +205,7 @@ async def test_set_infrared_brightness_100_percent(hass: HomeAssistant) -> None:
await async_setup_component(hass, lifx.DOMAIN, {lifx.DOMAIN: {}})
await hass.async_block_till_done()
entity_id = "select.my_bulb_infrared_brightness"
entity_id = "select.my_group_my_bulb_infrared_brightness"
await hass.services.async_call(
SELECT_DOMAIN,
@@ -247,7 +247,7 @@ async def test_disable_infrared(hass: HomeAssistant) -> None:
await async_setup_component(hass, lifx.DOMAIN, {lifx.DOMAIN: {}})
await hass.async_block_till_done()
entity_id = "select.my_bulb_infrared_brightness"
entity_id = "select.my_group_my_bulb_infrared_brightness"
await hass.services.async_call(
SELECT_DOMAIN,
@@ -289,7 +289,7 @@ async def test_invalid_infrared_brightness(hass: HomeAssistant) -> None:
await async_setup_component(hass, lifx.DOMAIN, {lifx.DOMAIN: {}})
await hass.async_block_till_done()
entity_id = "select.my_bulb_infrared_brightness"
entity_id = "select.my_group_my_bulb_infrared_brightness"
bulb.get_infrared = MockLifxCommand(bulb, infrared_brightness=12345)
+2 -2
View File
@@ -54,7 +54,7 @@ async def test_rssi_sensor(
await async_setup_component(hass, lifx.DOMAIN, {lifx.DOMAIN: {}})
await hass.async_block_till_done()
entity_id = "sensor.my_bulb_rssi"
entity_id = "sensor.my_group_my_bulb_rssi"
assert not hass.states.get(entity_id)
entry = entity_registry.entities.get(entity_id)
@@ -109,7 +109,7 @@ async def test_rssi_sensor_old_firmware(
await async_setup_component(hass, lifx.DOMAIN, {lifx.DOMAIN: {}})
await hass.async_block_till_done()
entity_id = "sensor.my_bulb_rssi"
entity_id = "sensor.my_group_my_bulb_rssi"
entry = entity_registry.entities.get(entity_id)
assert entry
@@ -1,5 +1,5 @@
# serializer version: 1
# name: test_binary_sensor_setup[binary_sensor.test_occupancy_occupancy-entry]
# name: test_binary_sensor_setup[binary_sensor.test_area_test_occupancy_occupancy-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
@@ -13,7 +13,7 @@
'disabled_by': None,
'domain': 'binary_sensor',
'entity_category': None,
'entity_id': 'binary_sensor.test_occupancy_occupancy',
'entity_id': 'binary_sensor.test_area_test_occupancy_occupancy',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -36,7 +36,7 @@
'unit_of_measurement': None,
})
# ---
# name: test_binary_sensor_setup[binary_sensor.test_occupancy_occupancy-state]
# name: test_binary_sensor_setup[binary_sensor.test_area_test_occupancy_occupancy-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'occupancy',
@@ -44,7 +44,7 @@
'lutron_integration_id': 5,
}),
'context': <ANY>,
'entity_id': 'binary_sensor.test_occupancy_occupancy',
'entity_id': 'binary_sensor.test_area_test_occupancy_occupancy',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
@@ -1,5 +1,5 @@
# serializer version: 1
# name: test_cover_setup[cover.test_cover-entry]
# name: test_cover_setup[cover.test_area_test_cover-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
@@ -13,7 +13,7 @@
'disabled_by': None,
'domain': 'cover',
'entity_category': None,
'entity_id': 'cover.test_cover',
'entity_id': 'cover.test_area_test_cover',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -36,7 +36,7 @@
'unit_of_measurement': None,
})
# ---
# name: test_cover_setup[cover.test_cover-state]
# name: test_cover_setup[cover.test_area_test_cover-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'current_position': 0,
@@ -46,7 +46,7 @@
'supported_features': <CoverEntityFeature: 7>,
}),
'context': <ANY>,
'entity_id': 'cover.test_cover',
'entity_id': 'cover.test_area_test_cover',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
@@ -1,5 +1,5 @@
# serializer version: 1
# name: test_fan_setup[fan.test_fan-entry]
# name: test_fan_setup[fan.test_area_test_fan-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
@@ -15,7 +15,7 @@
'disabled_by': None,
'domain': 'fan',
'entity_category': None,
'entity_id': 'fan.test_fan',
'entity_id': 'fan.test_area_test_fan',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -38,7 +38,7 @@
'unit_of_measurement': None,
})
# ---
# name: test_fan_setup[fan.test_fan-state]
# name: test_fan_setup[fan.test_area_test_fan-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'friendly_name': 'Test Fan',
@@ -49,7 +49,7 @@
'supported_features': <FanEntityFeature: 49>,
}),
'context': <ANY>,
'entity_id': 'fan.test_fan',
'entity_id': 'fan.test_area_test_fan',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
@@ -1,5 +1,5 @@
# serializer version: 1
# name: test_light_setup[light.test_light-entry]
# name: test_light_setup[light.test_area_test_light-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
@@ -17,7 +17,7 @@
'disabled_by': None,
'domain': 'light',
'entity_category': None,
'entity_id': 'light.test_light',
'entity_id': 'light.test_area_test_light',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
@@ -40,7 +40,7 @@
'unit_of_measurement': None,
})
# ---
# name: test_light_setup[light.test_light-state]
# name: test_light_setup[light.test_area_test_light-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'brightness': None,
@@ -53,7 +53,7 @@
'supported_features': <LightEntityFeature: 40>,
}),
'context': <ANY>,
'entity_id': 'light.test_light',
'entity_id': 'light.test_area_test_light',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
@@ -1,4 +1,55 @@
# serializer version: 1
# name: test_switch_setup[switch.test_area_test_switch-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
]),
'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_area_test_switch',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'object_id_base': None,
'options': dict({
}),
'original_device_class': None,
'original_icon': None,
'original_name': None,
'platform': 'lutron',
'previous_unique_id': None,
'suggested_object_id': None,
'supported_features': 0,
'translation_key': None,
'unique_id': '12345678901_switch_uuid',
'unit_of_measurement': None,
})
# ---
# name: test_switch_setup[switch.test_area_test_switch-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'friendly_name': 'Test Switch',
'lutron_integration_id': 2,
}),
'context': <ANY>,
'entity_id': 'switch.test_area_test_switch',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'off',
})
# ---
# name: test_switch_setup[switch.test_keypad_test_button-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
@@ -52,54 +103,3 @@
'state': 'off',
})
# ---
# name: test_switch_setup[switch.test_switch-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
]),
'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_switch',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'object_id_base': None,
'options': dict({
}),
'original_device_class': None,
'original_icon': None,
'original_name': None,
'platform': 'lutron',
'previous_unique_id': None,
'suggested_object_id': None,
'supported_features': 0,
'translation_key': None,
'unique_id': '12345678901_switch_uuid',
'unit_of_measurement': None,
})
# ---
# name: test_switch_setup[switch.test_switch-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'friendly_name': 'Test Switch',
'lutron_integration_id': 2,
}),
'context': <ANY>,
'entity_id': 'switch.test_switch',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'off',
})
# ---
@@ -51,7 +51,7 @@ async def test_binary_sensor_update(
await hass.config_entries.async_setup(mock_config_entry.entry_id)
await hass.async_block_till_done()
entity_id = "binary_sensor.test_occupancy_occupancy"
entity_id = "binary_sensor.test_area_test_occupancy_occupancy"
assert hass.states.get(entity_id).state == STATE_OFF
# Simulate update
+2 -2
View File
@@ -61,7 +61,7 @@ async def test_cover_services(
await hass.config_entries.async_setup(mock_config_entry.entry_id)
await hass.async_block_till_done()
entity_id = "cover.test_cover"
entity_id = "cover.test_area_test_cover"
# Open cover
await hass.services.async_call(
@@ -104,7 +104,7 @@ async def test_cover_update(
await hass.config_entries.async_setup(mock_config_entry.entry_id)
await hass.async_block_till_done()
entity_id = "cover.test_cover"
entity_id = "cover.test_area_test_cover"
assert hass.states.get(entity_id).state == STATE_CLOSED
# Simulate update
+2 -2
View File
@@ -59,7 +59,7 @@ async def test_fan_services(
await hass.config_entries.async_setup(mock_config_entry.entry_id)
await hass.async_block_till_done()
entity_id = "fan.test_fan"
entity_id = "fan.test_area_test_fan"
# Turn on (defaults to medium - 67%)
await hass.services.async_call(
@@ -102,7 +102,7 @@ async def test_fan_update(
await hass.config_entries.async_setup(mock_config_entry.entry_id)
await hass.async_block_till_done()
entity_id = "fan.test_fan"
entity_id = "fan.test_area_test_fan"
assert hass.states.get(entity_id).state == STATE_OFF
# Simulate update
+1 -1
View File
@@ -32,7 +32,7 @@ async def test_setup_entry(
entity_registry = er.async_get(hass)
# The light from mock_lutron has uuid="light_uuid" and guid="12345678901"
expected_unique_id = "12345678901_light_uuid"
entry = entity_registry.async_get("light.test_light")
entry = entity_registry.async_get("light.test_area_test_light")
assert entry.unique_id == expected_unique_id
+5 -5
View File
@@ -65,7 +65,7 @@ async def test_light_turn_on_off(
await hass.config_entries.async_setup(mock_config_entry.entry_id)
await hass.async_block_till_done()
entity_id = "light.test_light"
entity_id = "light.test_area_test_light"
# Turn on
await hass.services.async_call(
@@ -99,7 +99,7 @@ async def test_light_update(
await hass.config_entries.async_setup(mock_config_entry.entry_id)
await hass.async_block_till_done()
entity_id = "light.test_light"
entity_id = "light.test_area_test_light"
assert hass.states.get(entity_id).state == STATE_OFF
# Simulate update from library
@@ -126,7 +126,7 @@ async def test_light_transition(
await hass.config_entries.async_setup(mock_config_entry.entry_id)
await hass.async_block_till_done()
entity_id = "light.test_light"
entity_id = "light.test_area_test_light"
# Turn on with transition
await hass.services.async_call(
@@ -161,7 +161,7 @@ async def test_light_flash(
await hass.config_entries.async_setup(mock_config_entry.entry_id)
await hass.async_block_till_done()
entity_id = "light.test_light"
entity_id = "light.test_area_test_light"
# Short flash
await hass.services.async_call(
@@ -195,7 +195,7 @@ async def test_light_brightness_restore(
await hass.config_entries.async_setup(mock_config_entry.entry_id)
await hass.async_block_till_done()
entity_id = "light.test_light"
entity_id = "light.test_area_test_light"
# Turn on first time - uses default (50%)
await hass.services.async_call(
+1 -1
View File
@@ -64,7 +64,7 @@ async def test_switch_turn_on_off(
await hass.config_entries.async_setup(mock_config_entry.entry_id)
await hass.async_block_till_done()
entity_id = "switch.test_switch"
entity_id = "switch.test_area_test_switch"
# Turn on
await hass.services.async_call(
@@ -35,9 +35,11 @@ async def test_battery_sensor_is_attached_to_shade_device(
"""Test the battery sensor is registered under the same shade device."""
await async_setup_integration(hass, MockBridge)
cover_entry = entity_registry.async_get("cover.basement_bedroom_left_shade")
cover_entry = entity_registry.async_get(
"cover.basement_bedroom_basement_bedroom_left_shade"
)
binary_sensor_entry = entity_registry.async_get(
"binary_sensor.basement_bedroom_left_shade_battery"
"binary_sensor.basement_bedroom_basement_bedroom_left_shade_battery"
)
assert cover_entry is not None
@@ -58,7 +60,7 @@ async def test_battery_sensor_does_not_replace_shade_subscriber(
await async_setup_integration(hass, factory)
await hass.async_block_till_done()
cover_entity_id = "cover.basement_bedroom_left_shade"
cover_entity_id = "cover.basement_bedroom_basement_bedroom_left_shade"
instance.devices["802"]["current_state"] = 50
instance.call_subscribers("802")
await hass.async_block_till_done()
@@ -85,7 +87,9 @@ async def test_battery_sensor_updates_on_schedule(
await async_setup_integration(hass, factory)
await hass.async_block_till_done()
binary_sensor_entity_id = "binary_sensor.basement_bedroom_left_shade_battery"
binary_sensor_entity_id = (
"binary_sensor.basement_bedroom_basement_bedroom_left_shade_battery"
)
initial_state = hass.states.get(binary_sensor_entity_id)
assert initial_state is not None
assert initial_state.state == STATE_OFF

Some files were not shown because too many files have changed in this diff Show More