1
0
mirror of https://github.com/home-assistant/core.git synced 2026-02-15 07:36:16 +00:00

Add new sensors for Zigbee based devices in ViCare (#154271)

This commit is contained in:
Christopher Fenner
2025-10-16 12:11:08 +02:00
committed by GitHub
parent aa8198d852
commit 1bdba7906a
10 changed files with 3326 additions and 142 deletions

View File

@@ -24,6 +24,7 @@ from homeassistant.components.binary_sensor import (
BinarySensorEntity,
BinarySensorEntityDescription,
)
from homeassistant.const import EntityCategory
from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity_platform import AddConfigEntryEntitiesCallback
@@ -117,6 +118,32 @@ GLOBAL_SENSORS: tuple[ViCareBinarySensorEntityDescription, ...] = (
device_class=BinarySensorDeviceClass.PROBLEM,
value_getter=lambda api: len(api.getDeviceErrors()) > 0,
),
ViCareBinarySensorEntityDescription(
key="identification_mode",
translation_key="identification_mode",
entity_category=EntityCategory.DIAGNOSTIC,
value_getter=lambda api: api.getIdentification(),
entity_registry_enabled_default=False,
),
ViCareBinarySensorEntityDescription(
key="mounting_mode",
translation_key="mounting_mode",
entity_category=EntityCategory.DIAGNOSTIC,
value_getter=lambda api: api.getMountingMode(),
entity_registry_enabled_default=False,
),
ViCareBinarySensorEntityDescription(
key="child_safety_lock_mode",
translation_key="child_safety_lock_mode",
value_getter=lambda api: api.getChildLock() == "active",
entity_registry_enabled_default=False,
),
ViCareBinarySensorEntityDescription(
key="valve",
translation_key="valve",
device_class=BinarySensorDeviceClass.DOOR,
value_getter=lambda api: api.isValveOpen(),
),
)

View File

@@ -21,6 +21,15 @@
},
"one_time_charge": {
"default": "mdi:shower-head"
},
"mounting_mode": {
"default": "mdi:wrench"
},
"child_safety_lock_mode": {
"default": "mdi:lock"
},
"valve": {
"default": "mdi:pipe-valve"
}
},
"button": {
@@ -90,6 +99,12 @@
},
"ventilation_level": {
"default": "mdi:fan"
},
"zigbee_signal_strength": {
"default": "mdi:wifi"
},
"valve_position": {
"default": "mdi:pipe-valve"
}
}
},

View File

@@ -943,6 +943,23 @@ GLOBAL_SENSORS: tuple[ViCareSensorEntityDescription, ...] = (
entity_category=EntityCategory.DIAGNOSTIC,
value_getter=lambda api: api.getBatteryLevel(),
),
ViCareSensorEntityDescription(
key="zigbee_signal_strength",
translation_key="zigbee_signal_strength",
state_class=SensorStateClass.MEASUREMENT,
entity_category=EntityCategory.DIAGNOSTIC,
native_unit_of_measurement=PERCENTAGE,
value_getter=lambda api: api.getZigbeeSignalStrength(),
entity_registry_enabled_default=False,
),
ViCareSensorEntityDescription(
key="valve_position",
translation_key="valve_position",
state_class=SensorStateClass.MEASUREMENT,
native_unit_of_measurement=PERCENTAGE,
value_getter=lambda api: api.getValvePosition(),
entity_registry_enabled_default=False,
),
ViCareSensorEntityDescription(
key="fuel_need",
translation_key="fuel_need",

View File

@@ -66,6 +66,18 @@
},
"one_time_charge": {
"name": "One-time charge"
},
"identification_mode": {
"name": "Identification mode"
},
"mounting_mode": {
"name": "Mounting mode"
},
"child_safety_lock_mode": {
"name": "Child safety lock"
},
"valve": {
"name": "Valve"
}
},
"button": {
@@ -502,6 +514,12 @@
},
"fuel_need": {
"name": "Fuel need"
},
"zigbee_signal_strength": {
"name": "[%key:component::sensor::entity_component::signal_strength::name%]"
},
"valve_position": {
"name": "Valve position"
}
},
"water_heater": {

View File

@@ -0,0 +1,143 @@
{
"data": [
{
"apiVersion": 1,
"commands": {},
"deviceId": "zigbee-################",
"feature": "device.identification",
"gatewayId": "################",
"isEnabled": true,
"isReady": true,
"properties": {
"triggered": {
"type": "boolean",
"value": false
}
},
"timestamp": "2025-10-05T14:18:37.089Z",
"uri": "https://api.viessmann-climatesolutions.com/iot/v2/features/installations/#######/gateways/################/devices/zigbee-################/features/device.identification"
},
{
"apiVersion": 1,
"commands": {},
"deviceId": "zigbee-################",
"feature": "device.messages.status.raw",
"gatewayId": "################",
"isEnabled": true,
"isReady": true,
"properties": {
"entries": {
"type": "array",
"value": []
}
},
"timestamp": "2025-10-05T14:18:37.089Z",
"uri": "https://api.viessmann-climatesolutions.com/iot/v2/features/installations/#######/gateways/################/devices/zigbee-################/features/device.messages.status.raw"
},
{
"apiVersion": 1,
"commands": {
"setName": {
"isExecutable": true,
"name": "setName",
"params": {
"name": {
"constraints": {
"maxLength": 40,
"minLength": 1,
"regEx": "^[\\p{L}0-9]+( [\\p{L}0-9]+)*$"
},
"required": true,
"type": "string"
}
},
"uri": "https://api.viessmann-climatesolutions.com/iot/v2/features/installations/#######/gateways/################/devices/zigbee-################/features/device.name/commands/setName"
}
},
"deviceId": "zigbee-################",
"feature": "device.name",
"gatewayId": "################",
"isEnabled": true,
"isReady": true,
"properties": {
"name": {
"type": "string",
"value": "OG Repeater"
}
},
"timestamp": "2025-10-05T14:18:37.089Z",
"uri": "https://api.viessmann-climatesolutions.com/iot/v2/features/installations/#######/gateways/################/devices/zigbee-################/features/device.name"
},
{
"apiVersion": 1,
"commands": {},
"deviceId": "zigbee-################",
"feature": "device.zigbee.lqi",
"gatewayId": "################",
"isEnabled": true,
"isReady": true,
"properties": {
"strength": {
"type": "number",
"unit": "percent",
"value": 46
}
},
"timestamp": "2025-10-06T11:06:23.603Z",
"uri": "https://api.viessmann-climatesolutions.com/iot/v2/features/installations/#######/gateways/################/devices/zigbee-################/features/device.zigbee.lqi"
},
{
"apiVersion": 1,
"commands": {},
"deviceId": "zigbee-################",
"feature": "device.zigbee.parent.id",
"gatewayId": "################",
"isEnabled": true,
"isReady": true,
"properties": {
"value": {
"type": "string",
"value": "################"
}
},
"timestamp": "2025-10-06T11:05:13.499Z",
"uri": "https://api.viessmann-climatesolutions.com/iot/v2/features/installations/#######/gateways/################/devices/zigbee-################/features/device.zigbee.parent.id"
},
{
"apiVersion": 1,
"commands": {},
"deviceId": "zigbee-################",
"feature": "device.zigbee.parent.rx",
"gatewayId": "################",
"isEnabled": true,
"isReady": true,
"properties": {
"value": {
"type": "number",
"unit": "",
"value": 125
}
},
"timestamp": "2025-10-06T11:07:24.638Z",
"uri": "https://api.viessmann-climatesolutions.com/iot/v2/features/installations/#######/gateways/################/devices/zigbee-################/features/device.zigbee.parent.rx"
},
{
"apiVersion": 1,
"commands": {},
"deviceId": "zigbee-################",
"feature": "device.zigbee.parent.tx",
"gatewayId": "################",
"isEnabled": true,
"isReady": true,
"properties": {
"value": {
"type": "number",
"unit": "",
"value": 122
}
},
"timestamp": "2025-10-06T11:06:23.603Z",
"uri": "https://api.viessmann-climatesolutions.com/iot/v2/features/installations/#######/gateways/################/devices/zigbee-################/features/device.zigbee.parent.tx"
}
]
}

View File

@@ -0,0 +1,327 @@
{
"data": [
{
"apiVersion": 1,
"commands": {},
"deviceId": "zigbee-################",
"feature": "device.configuration.measurementWeight",
"gatewayId": "################",
"isEnabled": true,
"isReady": true,
"properties": {
"weight": {
"type": "number",
"unit": "",
"value": 20
}
},
"timestamp": "2025-10-05T14:18:33.979Z",
"uri": "https://api.viessmann-climatesolutions.com/iot/v2/features/installations/#######/gateways/################/devices/zigbee-################/features/device.configuration.measurementWeight"
},
{
"apiVersion": 1,
"commands": {},
"deviceId": "zigbee-################",
"feature": "device.heatingCircuitId",
"gatewayId": "################",
"isEnabled": true,
"isReady": true,
"properties": {
"value": {
"type": "number",
"unit": "",
"value": 1
}
},
"timestamp": "2025-10-05T14:18:33.979Z",
"uri": "https://api.viessmann-climatesolutions.com/iot/v2/features/installations/#######/gateways/################/devices/zigbee-################/features/device.heatingCircuitId"
},
{
"apiVersion": 1,
"commands": {},
"deviceId": "zigbee-################",
"feature": "device.identification",
"gatewayId": "################",
"isEnabled": true,
"isReady": true,
"properties": {
"triggered": {
"type": "boolean",
"value": false
}
},
"timestamp": "2025-10-05T14:18:33.979Z",
"uri": "https://api.viessmann-climatesolutions.com/iot/v2/features/installations/#######/gateways/################/devices/zigbee-################/features/device.identification"
},
{
"apiVersion": 1,
"commands": {},
"deviceId": "zigbee-################",
"feature": "device.information",
"gatewayId": "################",
"isEnabled": true,
"isReady": true,
"properties": {
"manufacturer": {
"type": "string",
"value": "Viessmann"
},
"modelId": {
"type": "string",
"value": "#######"
}
},
"timestamp": "2025-10-05T14:18:33.979Z",
"uri": "https://api.viessmann-climatesolutions.com/iot/v2/features/installations/#######/gateways/################/devices/zigbee-################/features/device.information"
},
{
"apiVersion": 1,
"commands": {},
"deviceId": "zigbee-################",
"feature": "device.messages.status.raw",
"gatewayId": "################",
"isEnabled": true,
"isReady": true,
"properties": {
"entries": {
"type": "array",
"value": []
}
},
"timestamp": "2025-10-05T14:18:33.979Z",
"uri": "https://api.viessmann-climatesolutions.com/iot/v2/features/installations/#######/gateways/################/devices/zigbee-################/features/device.messages.status.raw"
},
{
"apiVersion": 1,
"commands": {
"setName": {
"isExecutable": true,
"name": "setName",
"params": {
"name": {
"constraints": {
"maxLength": 40,
"minLength": 1,
"regEx": "^[\\p{L}0-9]+( [\\p{L}0-9]+)*$"
},
"required": true,
"type": "string"
}
},
"uri": "https://api.viessmann-climatesolutions.com/iot/v2/features/installations/#######/gateways/################/devices/zigbee-################/features/device.name/commands/setName"
}
},
"deviceId": "zigbee-################",
"feature": "device.name",
"gatewayId": "################",
"isEnabled": true,
"isReady": true,
"properties": {
"name": {
"type": "string",
"value": "Thermostat UG Flur"
}
},
"timestamp": "2025-10-05T14:18:33.979Z",
"uri": "https://api.viessmann-climatesolutions.com/iot/v2/features/installations/#######/gateways/################/devices/zigbee-################/features/device.name"
},
{
"apiVersion": 1,
"commands": {},
"deviceId": "zigbee-################",
"feature": "device.power.battery",
"gatewayId": "################",
"isEnabled": true,
"isReady": true,
"properties": {
"level": {
"type": "number",
"unit": "percent",
"value": 36
}
},
"timestamp": "2025-10-05T14:18:33.979Z",
"uri": "https://api.viessmann-climatesolutions.com/iot/v2/features/installations/#######/gateways/################/devices/zigbee-################/features/device.power.battery"
},
{
"apiVersion": 1,
"commands": {},
"deviceId": "zigbee-################",
"feature": "device.sensors.temperature",
"gatewayId": "################",
"isEnabled": true,
"isReady": true,
"properties": {
"status": {
"type": "string",
"value": "connected"
},
"value": {
"type": "number",
"unit": "celsius",
"value": 21.5
}
},
"timestamp": "2025-10-06T11:07:20.743Z",
"uri": "https://api.viessmann-climatesolutions.com/iot/v2/features/installations/#######/gateways/################/devices/zigbee-################/features/device.sensors.temperature"
},
{
"apiVersion": 1,
"commands": {},
"deviceId": "zigbee-################",
"feature": "device.zigbee.lqi",
"gatewayId": "################",
"isEnabled": true,
"isReady": true,
"properties": {
"strength": {
"type": "number",
"unit": "percent",
"value": 90
}
},
"timestamp": "2025-10-06T03:45:38.469Z",
"uri": "https://api.viessmann-climatesolutions.com/iot/v2/features/installations/#######/gateways/################/devices/zigbee-################/features/device.zigbee.lqi"
},
{
"apiVersion": 1,
"commands": {},
"deviceId": "zigbee-################",
"feature": "device.zigbee.parent.id",
"gatewayId": "################",
"isEnabled": true,
"isReady": true,
"properties": {
"value": {
"type": "string",
"value": "################"
}
},
"timestamp": "2025-10-05T14:18:33.979Z",
"uri": "https://api.viessmann-climatesolutions.com/iot/v2/features/installations/#######/gateways/################/devices/zigbee-################/features/device.zigbee.parent.id"
},
{
"apiVersion": 1,
"commands": {},
"deviceId": "zigbee-################",
"feature": "device.zigbee.parent.rx",
"gatewayId": "################",
"isEnabled": true,
"isReady": true,
"properties": {
"value": {
"type": "number",
"unit": "",
"value": 232
}
},
"timestamp": "2025-10-06T07:40:28.475Z",
"uri": "https://api.viessmann-climatesolutions.com/iot/v2/features/installations/#######/gateways/################/devices/zigbee-################/features/device.zigbee.parent.rx"
},
{
"apiVersion": 1,
"commands": {},
"deviceId": "zigbee-################",
"feature": "device.zigbee.parent.tx",
"gatewayId": "################",
"isEnabled": true,
"isReady": true,
"properties": {
"value": {
"type": "number",
"unit": "",
"value": 232
}
},
"timestamp": "2025-10-06T10:59:21.173Z",
"uri": "https://api.viessmann-climatesolutions.com/iot/v2/features/installations/#######/gateways/################/devices/zigbee-################/features/device.zigbee.parent.tx"
},
{
"apiVersion": 1,
"commands": {},
"deviceId": "zigbee-################",
"feature": "trv.childLock",
"gatewayId": "################",
"isEnabled": true,
"isReady": true,
"properties": {
"status": {
"type": "string",
"value": "active"
}
},
"timestamp": "2025-10-05T14:18:33.979Z",
"uri": "https://api.viessmann-climatesolutions.com/iot/v2/features/installations/#######/gateways/################/devices/zigbee-################/features/trv.childLock"
},
{
"apiVersion": 1,
"commands": {},
"deviceId": "zigbee-################",
"feature": "trv.mountingMode",
"gatewayId": "################",
"isEnabled": true,
"isReady": true,
"properties": {
"active": {
"type": "boolean",
"value": false
}
},
"timestamp": "2025-10-05T14:18:33.979Z",
"uri": "https://api.viessmann-climatesolutions.com/iot/v2/features/installations/#######/gateways/################/devices/zigbee-################/features/trv.mountingMode"
},
{
"apiVersion": 1,
"commands": {
"setTargetTemperature": {
"isExecutable": true,
"name": "setTargetTemperature",
"params": {
"temperature": {
"constraints": {
"max": 30,
"min": 8,
"stepping": 0.5
},
"required": true,
"type": "number"
}
},
"uri": "https://api.viessmann-climatesolutions.com/iot/v2/features/installations/#######/gateways/################/devices/zigbee-################/features/trv.temperature/commands/setTargetTemperature"
}
},
"deviceId": "zigbee-################",
"feature": "trv.temperature",
"gatewayId": "################",
"isEnabled": true,
"isReady": true,
"properties": {
"value": {
"type": "number",
"unit": "celsius",
"value": 21.5
}
},
"timestamp": "2025-10-06T06:51:17.042Z",
"uri": "https://api.viessmann-climatesolutions.com/iot/v2/features/installations/#######/gateways/################/devices/zigbee-################/features/trv.temperature"
},
{
"apiVersion": 1,
"commands": {},
"deviceId": "zigbee-################",
"feature": "trv.valve.position",
"gatewayId": "################",
"isEnabled": true,
"isReady": true,
"properties": {
"position": {
"type": "number",
"unit": "percent",
"value": 2
}
},
"timestamp": "2025-10-06T11:03:17.282Z",
"uri": "https://api.viessmann-climatesolutions.com/iot/v2/features/installations/#######/gateways/################/devices/zigbee-################/features/trv.valve.position"
}
]
}

View File

@@ -438,6 +438,247 @@
'state': 'unavailable',
})
# ---
# name: test_all_entities[binary_sensor.model1_child_safety_lock-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': None,
'config_entry_id': <ANY>,
'config_subentry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'binary_sensor',
'entity_category': None,
'entity_id': 'binary_sensor.model1_child_safety_lock',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'options': dict({
}),
'original_device_class': None,
'original_icon': None,
'original_name': 'Child safety lock',
'platform': 'vicare',
'previous_unique_id': None,
'suggested_object_id': None,
'supported_features': 0,
'translation_key': 'child_safety_lock_mode',
'unique_id': 'gateway1_zigbee_################-child_safety_lock_mode',
'unit_of_measurement': None,
})
# ---
# name: test_all_entities[binary_sensor.model1_child_safety_lock-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'friendly_name': 'model1 Child safety lock',
}),
'context': <ANY>,
'entity_id': 'binary_sensor.model1_child_safety_lock',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'unavailable',
})
# ---
# name: test_all_entities[binary_sensor.model1_identification_mode-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': None,
'config_entry_id': <ANY>,
'config_subentry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'binary_sensor',
'entity_category': <EntityCategory.DIAGNOSTIC: 'diagnostic'>,
'entity_id': 'binary_sensor.model1_identification_mode',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'options': dict({
}),
'original_device_class': None,
'original_icon': None,
'original_name': 'Identification mode',
'platform': 'vicare',
'previous_unique_id': None,
'suggested_object_id': None,
'supported_features': 0,
'translation_key': 'identification_mode',
'unique_id': 'gateway1_zigbee_################-identification_mode',
'unit_of_measurement': None,
})
# ---
# name: test_all_entities[binary_sensor.model1_identification_mode-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'friendly_name': 'model1 Identification mode',
}),
'context': <ANY>,
'entity_id': 'binary_sensor.model1_identification_mode',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'unavailable',
})
# ---
# name: test_all_entities[binary_sensor.model1_mounting_mode-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': None,
'config_entry_id': <ANY>,
'config_subentry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'binary_sensor',
'entity_category': <EntityCategory.DIAGNOSTIC: 'diagnostic'>,
'entity_id': 'binary_sensor.model1_mounting_mode',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'options': dict({
}),
'original_device_class': None,
'original_icon': None,
'original_name': 'Mounting mode',
'platform': 'vicare',
'previous_unique_id': None,
'suggested_object_id': None,
'supported_features': 0,
'translation_key': 'mounting_mode',
'unique_id': 'gateway1_zigbee_################-mounting_mode',
'unit_of_measurement': None,
})
# ---
# name: test_all_entities[binary_sensor.model1_mounting_mode-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'friendly_name': 'model1 Mounting mode',
}),
'context': <ANY>,
'entity_id': 'binary_sensor.model1_mounting_mode',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'unavailable',
})
# ---
# name: test_all_entities[binary_sensor.model1_valve-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': None,
'config_entry_id': <ANY>,
'config_subentry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'binary_sensor',
'entity_category': None,
'entity_id': 'binary_sensor.model1_valve',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'options': dict({
}),
'original_device_class': <BinarySensorDeviceClass.DOOR: 'door'>,
'original_icon': None,
'original_name': 'Valve',
'platform': 'vicare',
'previous_unique_id': None,
'suggested_object_id': None,
'supported_features': 0,
'translation_key': 'valve',
'unique_id': 'gateway1_zigbee_################-valve',
'unit_of_measurement': None,
})
# ---
# name: test_all_entities[binary_sensor.model1_valve-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'door',
'friendly_name': 'model1 Valve',
}),
'context': <ANY>,
'entity_id': 'binary_sensor.model1_valve',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'unavailable',
})
# ---
# name: test_all_entities[binary_sensor.model2_identification_mode-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': None,
'config_entry_id': <ANY>,
'config_subentry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'binary_sensor',
'entity_category': <EntityCategory.DIAGNOSTIC: 'diagnostic'>,
'entity_id': 'binary_sensor.model2_identification_mode',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'options': dict({
}),
'original_device_class': None,
'original_icon': None,
'original_name': 'Identification mode',
'platform': 'vicare',
'previous_unique_id': None,
'suggested_object_id': None,
'supported_features': 0,
'translation_key': 'identification_mode',
'unique_id': 'gateway2_zigbee_################-identification_mode',
'unit_of_measurement': None,
})
# ---
# name: test_all_entities[binary_sensor.model2_identification_mode-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'friendly_name': 'model2 Identification mode',
}),
'context': <ANY>,
'entity_id': 'binary_sensor.model2_identification_mode',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'unavailable',
})
# ---
# name: test_binary_sensors[burner]
StateSnapshot({
'attributes': ReadOnlyDict({

File diff suppressed because it is too large Load Diff

View File

@@ -41,7 +41,11 @@ async def test_all_entities(
entity_registry: er.EntityRegistry,
) -> None:
"""Test all entities."""
fixtures: list[Fixture] = [Fixture({"type:boiler"}, "vicare/Vitodens300W.json")]
fixtures: list[Fixture] = [
Fixture({"type:boiler"}, "vicare/Vitodens300W.json"),
Fixture({"type:radiator"}, "vicare/ZigbeeTRV.json"),
Fixture({"type:repeater"}, "vicare/ZigbeeRepeater.json"),
]
with (
patch(f"{MODULE}.login", return_value=MockPyViCare(fixtures)),
patch(f"{MODULE}.PLATFORMS", [Platform.BINARY_SENSOR]),

View File

@@ -37,27 +37,10 @@ async def test_all_entities(
"""Test all entities."""
fixtures: list[Fixture] = [
Fixture({fixture_type}, fixture_data),
]
with (
patch(f"{MODULE}.login", return_value=MockPyViCare(fixtures)),
patch(f"{MODULE}.PLATFORMS", [Platform.SENSOR]),
):
await setup_integration(hass, mock_config_entry)
await snapshot_platform(hass, entity_registry, snapshot, mock_config_entry.entry_id)
@pytest.mark.usefixtures("entity_registry_enabled_by_default")
async def test_room_sensors(
hass: HomeAssistant,
snapshot: SnapshotAssertion,
mock_config_entry: MockConfigEntry,
entity_registry: er.EntityRegistry,
) -> None:
"""Test all entities."""
fixtures: list[Fixture] = [
Fixture({"type:climateSensor"}, "vicare/RoomSensor1.json"),
Fixture({"type:climateSensor"}, "vicare/RoomSensor2.json"),
Fixture({"type:radiator"}, "vicare/ZigbeeTRV.json"),
Fixture({"type:repeater"}, "vicare/ZigbeeRepeater.json"),
]
with (
patch(f"{MODULE}.login", return_value=MockPyViCare(fixtures)),