Add test cases for ViCare entities (#122983)

* add test case

* add test case

* add test case

* add test case

* add test case

* add test case

* remove commented code

* test only fan platform

* add test case

* remove fan mock
This commit is contained in:
Christopher Fenner 2024-08-21 14:42:58 +02:00 committed by GitHub
parent 8d97fafb2d
commit 52c0a09107
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
17 changed files with 3504 additions and 7 deletions

View File

@ -6,6 +6,9 @@ from typing import Final
from homeassistant.components.vicare.const import CONF_HEATING_TYPE from homeassistant.components.vicare.const import CONF_HEATING_TYPE
from homeassistant.const import CONF_CLIENT_ID, CONF_PASSWORD, CONF_USERNAME from homeassistant.const import CONF_CLIENT_ID, CONF_PASSWORD, CONF_USERNAME
from homeassistant.core import HomeAssistant
from tests.common import MockConfigEntry
MODULE = "homeassistant.components.vicare" MODULE = "homeassistant.components.vicare"
@ -17,3 +20,11 @@ ENTRY_CONFIG: Final[dict[str, str]] = {
} }
MOCK_MAC = "B874241B7B9" MOCK_MAC = "B874241B7B9"
async def setup_integration(hass: HomeAssistant, config_entry: MockConfigEntry) -> None:
"""Fixture for setting up the component."""
config_entry.add_to_hass(hass)
await hass.config_entries.async_setup(config_entry.entry_id)
await hass.async_block_till_done()

View File

@ -13,7 +13,7 @@ from PyViCare.PyViCareService import ViCareDeviceAccessor, readFeature
from homeassistant.components.vicare.const import DOMAIN from homeassistant.components.vicare.const import DOMAIN
from homeassistant.core import HomeAssistant from homeassistant.core import HomeAssistant
from . import ENTRY_CONFIG, MODULE from . import ENTRY_CONFIG, MODULE, setup_integration
from tests.common import MockConfigEntry, load_json_object_fixture from tests.common import MockConfigEntry, load_json_object_fixture
@ -40,7 +40,7 @@ class MockPyViCare:
), ),
f"deviceId{idx}", f"deviceId{idx}",
f"model{idx}", f"model{idx}",
f"online{idx}", "online",
) )
) )
@ -87,10 +87,7 @@ async def mock_vicare_gas_boiler(
f"{MODULE}.vicare_login", f"{MODULE}.vicare_login",
return_value=MockPyViCare(fixtures), return_value=MockPyViCare(fixtures),
): ):
mock_config_entry.add_to_hass(hass) await setup_integration(hass, mock_config_entry)
await hass.config_entries.async_setup(mock_config_entry.entry_id)
await hass.async_block_till_done()
yield mock_config_entry yield mock_config_entry

View File

@ -0,0 +1,882 @@
{
"data": [
{
"apiVersion": 1,
"commands": {},
"deviceId": "0",
"feature": "device.productIdentification",
"gatewayId": "################",
"isEnabled": true,
"isReady": true,
"properties": {
"product": {
"type": "object",
"value": {
"busAddress": 1,
"busType": "CanExternal",
"productFamily": "B_00028_VA330",
"viessmannIdentificationNumber": "################"
}
}
},
"timestamp": "2024-03-20T01:29:35.549Z",
"uri": "https://api.viessmann.com/iot/v1/features/installations/#######/gateways/################/devices/0/features/device.productIdentification"
},
{
"apiVersion": 1,
"commands": {},
"deviceId": "0",
"feature": "device.messages.errors.raw",
"gatewayId": "################",
"isEnabled": true,
"isReady": true,
"properties": {
"entries": {
"type": "array",
"value": []
}
},
"timestamp": "2024-03-20T01:29:35.549Z",
"uri": "https://api.viessmann.com/iot/v1/features/installations/#######/gateways/################/devices/0/features/device.messages.errors.raw"
},
{
"apiVersion": 1,
"commands": {},
"deviceId": "0",
"feature": "device.serial",
"gatewayId": "################",
"isEnabled": true,
"isReady": true,
"properties": {
"value": {
"type": "string",
"value": "################"
}
},
"timestamp": "2024-03-20T01:29:35.549Z",
"uri": "https://api.viessmann.com/iot/v1/features/installations/#######/gateways/################/devices/0/features/device.serial"
},
{
"apiVersion": 1,
"commands": {},
"deviceId": "0",
"feature": "ventilation",
"gatewayId": "################",
"isEnabled": true,
"isReady": true,
"properties": {
"active": {
"type": "boolean",
"value": true
}
},
"timestamp": "2024-03-20T01:29:35.549Z",
"uri": "https://api.viessmann.com/iot/v1/features/installations/#######/gateways/################/devices/0/features/ventilation"
},
{
"apiVersion": 1,
"commands": {},
"deviceId": "0",
"feature": "ventilation.levels.levelFour",
"gatewayId": "################",
"isEnabled": true,
"isReady": true,
"properties": {
"volumeFlow": {
"type": "number",
"unit": "cubicMeter/hour",
"value": 234
}
},
"timestamp": "2024-03-20T01:29:35.549Z",
"uri": "https://api.viessmann.com/iot/v1/features/installations/#######/gateways/################/devices/0/features/ventilation.levels.levelFour"
},
{
"apiVersion": 1,
"commands": {},
"deviceId": "0",
"feature": "ventilation.levels.levelOne",
"gatewayId": "################",
"isEnabled": true,
"isReady": true,
"properties": {
"volumeFlow": {
"type": "number",
"unit": "cubicMeter/hour",
"value": 54
}
},
"timestamp": "2024-03-20T01:29:35.549Z",
"uri": "https://api.viessmann.com/iot/v1/features/installations/#######/gateways/################/devices/0/features/ventilation.levels.levelOne"
},
{
"apiVersion": 1,
"commands": {},
"deviceId": "0",
"feature": "ventilation.levels.levelThree",
"gatewayId": "################",
"isEnabled": true,
"isReady": true,
"properties": {
"volumeFlow": {
"type": "number",
"unit": "cubicMeter/hour",
"value": 180
}
},
"timestamp": "2024-03-20T01:29:35.549Z",
"uri": "https://api.viessmann.com/iot/v1/features/installations/#######/gateways/################/devices/0/features/ventilation.levels.levelThree"
},
{
"apiVersion": 1,
"commands": {},
"deviceId": "0",
"feature": "ventilation.levels.levelTwo",
"gatewayId": "################",
"isEnabled": true,
"isReady": true,
"properties": {
"volumeFlow": {
"type": "number",
"unit": "cubicMeter/hour",
"value": 125
}
},
"timestamp": "2024-03-20T01:29:35.549Z",
"uri": "https://api.viessmann.com/iot/v1/features/installations/#######/gateways/################/devices/0/features/ventilation.levels.levelTwo"
},
{
"apiVersion": 1,
"commands": {
"setMode": {
"isExecutable": true,
"name": "setMode",
"params": {
"mode": {
"constraints": {
"enum": [
"permanent",
"ventilation",
"sensorOverride",
"sensorDriven"
]
},
"required": true,
"type": "string"
}
},
"uri": "https://api.viessmann.com/iot/v1/features/installations/#######/gateways/################/devices/0/features/ventilation.operating.modes.active/commands/setMode"
},
"setModeContinuousSensorOverride": {
"isExecutable": "true",
"name": "setModeContinuousSensorOverride",
"params": {},
"uri": "https://api.viessmann.com/iot/v1/features/installations/#######/gateways/################/devices/0/features/ventilation.operating.modes.active/commands/setModeContinuousSensorOverride"
}
},
"deviceId": "0",
"feature": "ventilation.operating.modes.active",
"gatewayId": "################",
"isEnabled": true,
"isReady": true,
"properties": {
"value": {
"type": "string",
"value": "permanent"
}
},
"timestamp": "2024-03-20T01:29:35.549Z",
"uri": "https://api.viessmann.com/iot/v1/features/installations/#######/gateways/################/devices/0/features/ventilation.operating.modes.active"
},
{
"apiVersion": 1,
"commands": {},
"deviceId": "0",
"feature": "ventilation.operating.modes.filterChange",
"gatewayId": "################",
"isEnabled": true,
"isReady": true,
"properties": {
"active": {
"type": "boolean",
"value": false
}
},
"timestamp": "2024-03-20T01:29:35.549Z",
"uri": "https://api.viessmann.com/iot/v1/features/installations/#######/gateways/################/devices/0/features/ventilation.operating.modes.filterChange"
},
{
"apiVersion": 1,
"commands": {
"setLevel": {
"isExecutable": true,
"name": "setLevel",
"params": {
"level": {
"constraints": {
"enum": ["levelOne", "levelTwo", "levelThree", "levelFour"]
},
"required": true,
"type": "string"
}
},
"uri": "https://api.viessmann.com/iot/v1/features/installations/#######/gateways/################/devices/0/features/ventilation.operating.modes.permanent/commands/setLevel"
}
},
"deviceId": "0",
"feature": "ventilation.operating.modes.permanent",
"gatewayId": "################",
"isEnabled": true,
"isReady": true,
"properties": {
"active": {
"type": "boolean",
"value": true
}
},
"timestamp": "2024-03-20T01:29:35.549Z",
"uri": "https://api.viessmann.com/iot/v1/features/installations/#######/gateways/################/devices/0/features/ventilation.operating.modes.permanent"
},
{
"apiVersion": 1,
"commands": {},
"deviceId": "0",
"feature": "ventilation.operating.modes.sensorDriven",
"gatewayId": "################",
"isEnabled": true,
"isReady": true,
"properties": {
"active": {
"type": "boolean",
"value": false
}
},
"timestamp": "2024-03-20T01:29:35.549Z",
"uri": "https://api.viessmann.com/iot/v1/features/installations/#######/gateways/################/devices/0/features/ventilation.operating.modes.sensorDriven"
},
{
"apiVersion": 1,
"commands": {},
"deviceId": "0",
"feature": "ventilation.operating.modes.sensorOverride",
"gatewayId": "################",
"isEnabled": true,
"isReady": true,
"properties": {
"active": {
"type": "boolean",
"value": false
}
},
"timestamp": "2024-03-20T01:29:35.549Z",
"uri": "https://api.viessmann.com/iot/v1/features/installations/#######/gateways/################/devices/0/features/ventilation.operating.modes.sensorOverride"
},
{
"apiVersion": 1,
"commands": {},
"deviceId": "0",
"feature": "ventilation.operating.modes.ventilation",
"gatewayId": "################",
"isEnabled": true,
"isReady": true,
"properties": {
"active": {
"type": "boolean",
"value": false
}
},
"timestamp": "2024-03-20T01:29:35.549Z",
"uri": "https://api.viessmann.com/iot/v1/features/installations/#######/gateways/################/devices/0/features/ventilation.operating.modes.ventilation"
},
{
"apiVersion": 1,
"commands": {},
"deviceId": "0",
"feature": "ventilation.operating.programs.active",
"gatewayId": "################",
"isEnabled": true,
"isReady": true,
"properties": {
"value": {
"type": "string",
"value": "levelOne"
}
},
"timestamp": "2024-03-20T01:29:35.549Z",
"uri": "https://api.viessmann.com/iot/v1/features/installations/#######/gateways/################/devices/0/features/ventilation.operating.programs.active"
},
{
"apiVersion": 1,
"commands": {
"activate": {
"isExecutable": true,
"name": "activate",
"params": {
"timeout": {
"constraints": {
"max": 1440,
"min": 1,
"stepping": 1
},
"required": false,
"type": "number"
}
},
"uri": "https://api.viessmann.com/iot/v1/features/installations/#######/gateways/################/devices/0/features/ventilation.operating.programs.forcedLevelFour/commands/activate"
},
"deactivate": {
"isExecutable": true,
"name": "deactivate",
"params": {},
"uri": "https://api.viessmann.com/iot/v1/features/installations/#######/gateways/################/devices/0/features/ventilation.operating.programs.forcedLevelFour/commands/deactivate"
},
"setDefaultRuntime": {
"isExecutable": true,
"name": "setDefaultRuntime",
"params": {
"defaultRuntime": {
"constraints": {
"max": 1440,
"min": 1,
"stepping": 1
},
"required": true,
"type": "number"
}
},
"uri": "https://api.viessmann.com/iot/v1/features/installations/#######/gateways/################/devices/0/features/ventilation.operating.programs.forcedLevelFour/commands/setDefaultRuntime"
},
"setTimeout": {
"isExecutable": true,
"name": "setTimeout",
"params": {
"timeout": {
"constraints": {
"max": 1440,
"min": 1,
"stepping": 1
},
"required": true,
"type": "number"
}
},
"uri": "https://api.viessmann.com/iot/v1/features/installations/#######/gateways/################/devices/0/features/ventilation.operating.programs.forcedLevelFour/commands/setTimeout"
}
},
"deviceId": "0",
"feature": "ventilation.operating.programs.forcedLevelFour",
"gatewayId": "################",
"isEnabled": true,
"isReady": true,
"properties": {
"active": {
"type": "boolean",
"value": false
},
"defaultRuntime": {
"type": "number",
"unit": "minutes",
"value": 30
},
"isActiveWritable": {
"type": "boolean",
"value": true
}
},
"timestamp": "2024-03-20T01:29:35.549Z",
"uri": "https://api.viessmann.com/iot/v1/features/installations/#######/gateways/################/devices/0/features/ventilation.operating.programs.forcedLevelFour"
},
{
"apiVersion": 1,
"commands": {},
"deviceId": "0",
"feature": "ventilation.operating.programs.levelFour",
"gatewayId": "################",
"isEnabled": true,
"isReady": true,
"properties": {
"active": {
"type": "boolean",
"value": false
},
"volumeFlow": {
"type": "number",
"unit": "cubicMeter/hour",
"value": 234
}
},
"timestamp": "2024-03-20T01:29:35.549Z",
"uri": "https://api.viessmann.com/iot/v1/features/installations/#######/gateways/################/devices/0/features/ventilation.operating.programs.levelFour"
},
{
"apiVersion": 1,
"commands": {},
"deviceId": "0",
"feature": "ventilation.operating.programs.levelOne",
"gatewayId": "################",
"isEnabled": true,
"isReady": true,
"properties": {
"active": {
"type": "boolean",
"value": true
},
"volumeFlow": {
"type": "number",
"unit": "cubicMeter/hour",
"value": 54
}
},
"timestamp": "2024-03-20T01:29:35.549Z",
"uri": "https://api.viessmann.com/iot/v1/features/installations/#######/gateways/################/devices/0/features/ventilation.operating.programs.levelOne"
},
{
"apiVersion": 1,
"commands": {},
"deviceId": "0",
"feature": "ventilation.operating.programs.levelThree",
"gatewayId": "################",
"isEnabled": true,
"isReady": true,
"properties": {
"active": {
"type": "boolean",
"value": false
},
"volumeFlow": {
"type": "number",
"unit": "cubicMeter/hour",
"value": 180
}
},
"timestamp": "2024-03-20T01:29:35.549Z",
"uri": "https://api.viessmann.com/iot/v1/features/installations/#######/gateways/################/devices/0/features/ventilation.operating.programs.levelThree"
},
{
"apiVersion": 1,
"commands": {},
"deviceId": "0",
"feature": "ventilation.operating.programs.levelTwo",
"gatewayId": "################",
"isEnabled": true,
"isReady": true,
"properties": {
"active": {
"type": "boolean",
"value": false
},
"volumeFlow": {
"type": "number",
"unit": "cubicMeter/hour",
"value": 125
}
},
"timestamp": "2024-03-20T01:29:35.549Z",
"uri": "https://api.viessmann.com/iot/v1/features/installations/#######/gateways/################/devices/0/features/ventilation.operating.programs.levelTwo"
},
{
"apiVersion": 1,
"commands": {
"activate": {
"isExecutable": true,
"name": "activate",
"params": {
"timeout": {
"constraints": {
"max": 1440,
"min": 1,
"stepping": 1
},
"required": false,
"type": "number"
}
},
"uri": "https://api.viessmann.com/iot/v1/features/installations/#######/gateways/################/devices/0/features/ventilation.operating.programs.silent/commands/activate"
},
"deactivate": {
"isExecutable": true,
"name": "deactivate",
"params": {},
"uri": "https://api.viessmann.com/iot/v1/features/installations/#######/gateways/################/devices/0/features/ventilation.operating.programs.silent/commands/deactivate"
},
"setDefaultRuntime": {
"isExecutable": true,
"name": "setDefaultRuntime",
"params": {
"defaultRuntime": {
"constraints": {
"max": 1440,
"min": 1,
"stepping": 1
},
"required": true,
"type": "number"
}
},
"uri": "https://api.viessmann.com/iot/v1/features/installations/#######/gateways/################/devices/0/features/ventilation.operating.programs.silent/commands/setDefaultRuntime"
},
"setTimeout": {
"isExecutable": true,
"name": "setTimeout",
"params": {
"timeout": {
"constraints": {
"max": 1440,
"min": 1,
"stepping": 1
},
"required": true,
"type": "number"
}
},
"uri": "https://api.viessmann.com/iot/v1/features/installations/#######/gateways/################/devices/0/features/ventilation.operating.programs.silent/commands/setTimeout"
}
},
"deviceId": "0",
"feature": "ventilation.operating.programs.silent",
"gatewayId": "################",
"isEnabled": true,
"isReady": true,
"properties": {
"active": {
"type": "boolean",
"value": false
},
"defaultRuntime": {
"type": "number",
"unit": "minutes",
"value": 30
},
"isActiveWritable": {
"type": "boolean",
"value": true
}
},
"timestamp": "2024-03-20T01:29:35.549Z",
"uri": "https://api.viessmann.com/iot/v1/features/installations/#######/gateways/################/devices/0/features/ventilation.operating.programs.silent"
},
{
"apiVersion": 1,
"commands": {},
"deviceId": "0",
"feature": "ventilation.operating.programs.standby",
"gatewayId": "################",
"isEnabled": true,
"isReady": true,
"properties": {
"active": {
"type": "boolean",
"value": false
},
"volumeFlow": {
"type": "number",
"unit": "cubicMeter/hour",
"value": 0
}
},
"timestamp": "2024-03-20T01:29:35.549Z",
"uri": "https://api.viessmann.com/iot/v1/features/installations/#######/gateways/################/devices/0/features/ventilation.operating.programs.standby"
},
{
"apiVersion": 1,
"commands": {},
"deviceId": "0",
"feature": "ventilation.operating.state",
"gatewayId": "################",
"isEnabled": true,
"isReady": true,
"properties": {
"demand": {
"type": "string",
"value": "ventilation"
},
"level": {
"type": "string",
"value": "levelOne"
},
"reason": {
"type": "string",
"value": "permanent"
}
},
"timestamp": "2024-03-20T01:29:35.549Z",
"uri": "https://api.viessmann.com/iot/v1/features/installations/#######/gateways/################/devices/0/features/ventilation.operating.state"
},
{
"apiVersion": 1,
"commands": {
"activate": {
"isExecutable": true,
"name": "activate",
"params": {
"timeout": {
"constraints": {
"max": 1440,
"min": 1,
"stepping": 1
},
"required": false,
"type": "number"
}
},
"uri": "https://api.viessmann.com/iot/v1/features/installations/#######/gateways/################/devices/0/features/ventilation.quickmodes.forcedLevelFour/commands/activate"
},
"deactivate": {
"isExecutable": true,
"name": "deactivate",
"params": {},
"uri": "https://api.viessmann.com/iot/v1/features/installations/#######/gateways/################/devices/0/features/ventilation.quickmodes.forcedLevelFour/commands/deactivate"
},
"setDefaultRuntime": {
"isExecutable": true,
"name": "setDefaultRuntime",
"params": {
"defaultRuntime": {
"constraints": {
"max": 1440,
"min": 1,
"stepping": 1
},
"required": true,
"type": "number"
}
},
"uri": "https://api.viessmann.com/iot/v1/features/installations/#######/gateways/################/devices/0/features/ventilation.quickmodes.forcedLevelFour/commands/setDefaultRuntime"
},
"setTimeout": {
"isExecutable": true,
"name": "setTimeout",
"params": {
"timeout": {
"constraints": {
"max": 1440,
"min": 1,
"stepping": 1
},
"required": true,
"type": "number"
}
},
"uri": "https://api.viessmann.com/iot/v1/features/installations/#######/gateways/################/devices/0/features/ventilation.quickmodes.forcedLevelFour/commands/setTimeout"
}
},
"deviceId": "0",
"feature": "ventilation.quickmodes.forcedLevelFour",
"gatewayId": "################",
"isEnabled": true,
"isReady": true,
"properties": {
"active": {
"type": "boolean",
"value": false
},
"defaultRuntime": {
"type": "number",
"unit": "minutes",
"value": 30
},
"isActiveWritable": {
"type": "boolean",
"value": true
}
},
"timestamp": "2024-03-20T01:29:35.549Z",
"uri": "https://api.viessmann.com/iot/v1/features/installations/#######/gateways/################/devices/0/features/ventilation.quickmodes.forcedLevelFour"
},
{
"apiVersion": 1,
"commands": {
"activate": {
"isExecutable": true,
"name": "activate",
"params": {
"timeout": {
"constraints": {
"max": 1440,
"min": 1,
"stepping": 1
},
"required": false,
"type": "number"
}
},
"uri": "https://api.viessmann.com/iot/v1/features/installations/#######/gateways/################/devices/0/features/ventilation.quickmodes.silent/commands/activate"
},
"deactivate": {
"isExecutable": true,
"name": "deactivate",
"params": {},
"uri": "https://api.viessmann.com/iot/v1/features/installations/#######/gateways/################/devices/0/features/ventilation.quickmodes.silent/commands/deactivate"
},
"setDefaultRuntime": {
"isExecutable": true,
"name": "setDefaultRuntime",
"params": {
"defaultRuntime": {
"constraints": {
"max": 1440,
"min": 1,
"stepping": 1
},
"required": true,
"type": "number"
}
},
"uri": "https://api.viessmann.com/iot/v1/features/installations/#######/gateways/################/devices/0/features/ventilation.quickmodes.silent/commands/setDefaultRuntime"
},
"setTimeout": {
"isExecutable": true,
"name": "setTimeout",
"params": {
"timeout": {
"constraints": {
"max": 1440,
"min": 1,
"stepping": 1
},
"required": true,
"type": "number"
}
},
"uri": "https://api.viessmann.com/iot/v1/features/installations/#######/gateways/################/devices/0/features/ventilation.quickmodes.silent/commands/setTimeout"
}
},
"deviceId": "0",
"feature": "ventilation.quickmodes.silent",
"gatewayId": "################",
"isEnabled": true,
"isReady": true,
"properties": {
"active": {
"type": "boolean",
"value": false
},
"defaultRuntime": {
"type": "number",
"unit": "minutes",
"value": 30
},
"isActiveWritable": {
"type": "boolean",
"value": true
}
},
"timestamp": "2024-03-20T01:29:35.549Z",
"uri": "https://api.viessmann.com/iot/v1/features/installations/#######/gateways/################/devices/0/features/ventilation.quickmodes.silent"
},
{
"apiVersion": 1,
"commands": {},
"deviceId": "0",
"feature": "heating.boiler.serial",
"gatewayId": "################",
"isEnabled": true,
"isReady": true,
"properties": {
"value": {
"type": "string",
"value": "################"
}
},
"timestamp": "2024-03-20T01:29:35.549Z",
"uri": "https://api.viessmann.com/iot/v1/features/installations/#######/gateways/################/devices/0/features/heating.boiler.serial"
},
{
"apiVersion": 1,
"commands": {
"setSchedule": {
"isExecutable": true,
"name": "setSchedule",
"params": {
"newSchedule": {
"constraints": {
"defaultMode": "levelOne",
"maxEntries": 4,
"modes": ["levelTwo", "levelThree"],
"overlapAllowed": false,
"resolution": 10
},
"required": true,
"type": "Schedule"
}
},
"uri": "https://api.viessmann.com/iot/v1/features/installations/#######/gateways/################/devices/0/features/ventilation.schedule/commands/setSchedule"
}
},
"deviceId": "0",
"feature": "ventilation.schedule",
"gatewayId": "################",
"isEnabled": true,
"isReady": true,
"properties": {
"active": {
"type": "boolean",
"value": false
},
"entries": {
"type": "Schedule",
"value": {
"fri": [
{
"end": "22:00",
"mode": "levelTwo",
"position": 0,
"start": "06:00"
}
],
"mon": [
{
"end": "22:00",
"mode": "levelTwo",
"position": 0,
"start": "06:00"
}
],
"sat": [
{
"end": "22:00",
"mode": "levelTwo",
"position": 0,
"start": "06:00"
}
],
"sun": [
{
"end": "22:00",
"mode": "levelTwo",
"position": 0,
"start": "06:00"
}
],
"thu": [
{
"end": "22:00",
"mode": "levelTwo",
"position": 0,
"start": "06:00"
}
],
"tue": [
{
"end": "22:00",
"mode": "levelTwo",
"position": 0,
"start": "06:00"
}
],
"wed": [
{
"end": "22:00",
"mode": "levelTwo",
"position": 0,
"start": "06:00"
}
]
}
}
},
"timestamp": "2024-03-20T01:29:35.549Z",
"uri": "https://api.viessmann.com/iot/v1/features/installations/#######/gateways/################/devices/0/features/ventilation.schedule"
}
]
}

View File

@ -1,4 +1,378 @@
# serializer version: 1 # serializer version: 1
# name: test_all_entities[binary_sensor.model0_burner-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': None,
'config_entry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'binary_sensor',
'entity_category': None,
'entity_id': 'binary_sensor.model0_burner',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'options': dict({
}),
'original_device_class': <BinarySensorDeviceClass.RUNNING: 'running'>,
'original_icon': None,
'original_name': 'Burner',
'platform': 'vicare',
'previous_unique_id': None,
'supported_features': 0,
'translation_key': 'burner',
'unique_id': 'gateway0-burner_active-0',
'unit_of_measurement': None,
})
# ---
# name: test_all_entities[binary_sensor.model0_burner-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'running',
'friendly_name': 'model0 Burner',
}),
'context': <ANY>,
'entity_id': 'binary_sensor.model0_burner',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'unavailable',
})
# ---
# name: test_all_entities[binary_sensor.model0_circulation_pump-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': None,
'config_entry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'binary_sensor',
'entity_category': None,
'entity_id': 'binary_sensor.model0_circulation_pump',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'options': dict({
}),
'original_device_class': <BinarySensorDeviceClass.RUNNING: 'running'>,
'original_icon': None,
'original_name': 'Circulation pump',
'platform': 'vicare',
'previous_unique_id': None,
'supported_features': 0,
'translation_key': 'circulation_pump',
'unique_id': 'gateway0-circulationpump_active-0',
'unit_of_measurement': None,
})
# ---
# name: test_all_entities[binary_sensor.model0_circulation_pump-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'running',
'friendly_name': 'model0 Circulation pump',
}),
'context': <ANY>,
'entity_id': 'binary_sensor.model0_circulation_pump',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'unavailable',
})
# ---
# name: test_all_entities[binary_sensor.model0_circulation_pump_2-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': None,
'config_entry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'binary_sensor',
'entity_category': None,
'entity_id': 'binary_sensor.model0_circulation_pump_2',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'options': dict({
}),
'original_device_class': <BinarySensorDeviceClass.RUNNING: 'running'>,
'original_icon': None,
'original_name': 'Circulation pump',
'platform': 'vicare',
'previous_unique_id': None,
'supported_features': 0,
'translation_key': 'circulation_pump',
'unique_id': 'gateway0-circulationpump_active-1',
'unit_of_measurement': None,
})
# ---
# name: test_all_entities[binary_sensor.model0_circulation_pump_2-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'running',
'friendly_name': 'model0 Circulation pump',
}),
'context': <ANY>,
'entity_id': 'binary_sensor.model0_circulation_pump_2',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'unavailable',
})
# ---
# name: test_all_entities[binary_sensor.model0_dhw_charging-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': None,
'config_entry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'binary_sensor',
'entity_category': None,
'entity_id': 'binary_sensor.model0_dhw_charging',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'options': dict({
}),
'original_device_class': <BinarySensorDeviceClass.RUNNING: 'running'>,
'original_icon': None,
'original_name': 'DHW charging',
'platform': 'vicare',
'previous_unique_id': None,
'supported_features': 0,
'translation_key': 'domestic_hot_water_charging',
'unique_id': 'gateway0-charging_active',
'unit_of_measurement': None,
})
# ---
# name: test_all_entities[binary_sensor.model0_dhw_charging-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'running',
'friendly_name': 'model0 DHW charging',
}),
'context': <ANY>,
'entity_id': 'binary_sensor.model0_dhw_charging',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'unavailable',
})
# ---
# name: test_all_entities[binary_sensor.model0_dhw_circulation_pump-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': None,
'config_entry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'binary_sensor',
'entity_category': None,
'entity_id': 'binary_sensor.model0_dhw_circulation_pump',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'options': dict({
}),
'original_device_class': <BinarySensorDeviceClass.RUNNING: 'running'>,
'original_icon': None,
'original_name': 'DHW circulation pump',
'platform': 'vicare',
'previous_unique_id': None,
'supported_features': 0,
'translation_key': 'domestic_hot_water_circulation_pump',
'unique_id': 'gateway0-dhw_circulationpump_active',
'unit_of_measurement': None,
})
# ---
# name: test_all_entities[binary_sensor.model0_dhw_circulation_pump-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'running',
'friendly_name': 'model0 DHW circulation pump',
}),
'context': <ANY>,
'entity_id': 'binary_sensor.model0_dhw_circulation_pump',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'unavailable',
})
# ---
# name: test_all_entities[binary_sensor.model0_dhw_pump-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': None,
'config_entry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'binary_sensor',
'entity_category': None,
'entity_id': 'binary_sensor.model0_dhw_pump',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'options': dict({
}),
'original_device_class': <BinarySensorDeviceClass.RUNNING: 'running'>,
'original_icon': None,
'original_name': 'DHW pump',
'platform': 'vicare',
'previous_unique_id': None,
'supported_features': 0,
'translation_key': 'domestic_hot_water_pump',
'unique_id': 'gateway0-dhw_pump_active',
'unit_of_measurement': None,
})
# ---
# name: test_all_entities[binary_sensor.model0_dhw_pump-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'running',
'friendly_name': 'model0 DHW pump',
}),
'context': <ANY>,
'entity_id': 'binary_sensor.model0_dhw_pump',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'unavailable',
})
# ---
# name: test_all_entities[binary_sensor.model0_frost_protection-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': None,
'config_entry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'binary_sensor',
'entity_category': None,
'entity_id': 'binary_sensor.model0_frost_protection',
'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': 'Frost protection',
'platform': 'vicare',
'previous_unique_id': None,
'supported_features': 0,
'translation_key': 'frost_protection',
'unique_id': 'gateway0-frost_protection_active-0',
'unit_of_measurement': None,
})
# ---
# name: test_all_entities[binary_sensor.model0_frost_protection-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'friendly_name': 'model0 Frost protection',
}),
'context': <ANY>,
'entity_id': 'binary_sensor.model0_frost_protection',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'unavailable',
})
# ---
# name: test_all_entities[binary_sensor.model0_frost_protection_2-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': None,
'config_entry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'binary_sensor',
'entity_category': None,
'entity_id': 'binary_sensor.model0_frost_protection_2',
'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': 'Frost protection',
'platform': 'vicare',
'previous_unique_id': None,
'supported_features': 0,
'translation_key': 'frost_protection',
'unique_id': 'gateway0-frost_protection_active-1',
'unit_of_measurement': None,
})
# ---
# name: test_all_entities[binary_sensor.model0_frost_protection_2-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'friendly_name': 'model0 Frost protection',
}),
'context': <ANY>,
'entity_id': 'binary_sensor.model0_frost_protection_2',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'unavailable',
})
# ---
# name: test_binary_sensors[burner] # name: test_binary_sensors[burner]
StateSnapshot({ StateSnapshot({
'attributes': ReadOnlyDict({ 'attributes': ReadOnlyDict({

View File

@ -0,0 +1,47 @@
# serializer version: 1
# name: test_all_entities[button.model0_activate_one_time_charge-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': None,
'config_entry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'button',
'entity_category': <EntityCategory.CONFIG: 'config'>,
'entity_id': 'button.model0_activate_one_time_charge',
'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': 'Activate one-time charge',
'platform': 'vicare',
'previous_unique_id': None,
'supported_features': 0,
'translation_key': 'activate_onetimecharge',
'unique_id': 'gateway0-activate_onetimecharge',
'unit_of_measurement': None,
})
# ---
# name: test_all_entities[button.model0_activate_one_time_charge-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'friendly_name': 'model0 Activate one-time charge',
}),
'context': <ANY>,
'entity_id': 'button.model0_activate_one_time_charge',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'unknown',
})
# ---

View File

@ -0,0 +1,167 @@
# serializer version: 1
# name: test_all_entities[climate.model0_heating-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': dict({
'hvac_modes': list([
]),
'max_temp': 37,
'min_temp': 3,
'preset_modes': list([
'comfort',
'eco',
'home',
'sleep',
]),
'target_temp_step': 1,
}),
'config_entry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'climate',
'entity_category': None,
'entity_id': 'climate.model0_heating',
'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': 'Heating',
'platform': 'vicare',
'previous_unique_id': None,
'supported_features': <ClimateEntityFeature: 401>,
'translation_key': 'heating',
'unique_id': 'gateway0-0',
'unit_of_measurement': None,
})
# ---
# name: test_all_entities[climate.model0_heating-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'current_temperature': None,
'friendly_name': 'model0 Heating',
'hvac_action': <HVACAction.IDLE: 'idle'>,
'hvac_modes': list([
]),
'max_temp': 37,
'min_temp': 3,
'preset_mode': None,
'preset_modes': list([
'comfort',
'eco',
'home',
'sleep',
]),
'supported_features': <ClimateEntityFeature: 401>,
'target_temp_step': 1,
'temperature': None,
'vicare_programs': list([
'comfort',
'eco',
'external',
'holiday',
'normal',
'reduced',
'standby',
]),
}),
'context': <ANY>,
'entity_id': 'climate.model0_heating',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'unknown',
})
# ---
# name: test_all_entities[climate.model0_heating_2-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': dict({
'hvac_modes': list([
]),
'max_temp': 37,
'min_temp': 3,
'preset_modes': list([
'comfort',
'eco',
'home',
'sleep',
]),
'target_temp_step': 1,
}),
'config_entry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'climate',
'entity_category': None,
'entity_id': 'climate.model0_heating_2',
'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': 'Heating',
'platform': 'vicare',
'previous_unique_id': None,
'supported_features': <ClimateEntityFeature: 401>,
'translation_key': 'heating',
'unique_id': 'gateway0-1',
'unit_of_measurement': None,
})
# ---
# name: test_all_entities[climate.model0_heating_2-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'current_temperature': None,
'friendly_name': 'model0 Heating',
'hvac_action': <HVACAction.IDLE: 'idle'>,
'hvac_modes': list([
]),
'max_temp': 37,
'min_temp': 3,
'preset_mode': None,
'preset_modes': list([
'comfort',
'eco',
'home',
'sleep',
]),
'supported_features': <ClimateEntityFeature: 401>,
'target_temp_step': 1,
'temperature': None,
'vicare_programs': list([
'comfort',
'eco',
'external',
'holiday',
'normal',
'reduced',
'standby',
]),
}),
'context': <ANY>,
'entity_id': 'climate.model0_heating_2',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'unknown',
})
# ---

View File

@ -0,0 +1,64 @@
# serializer version: 1
# name: test_all_entities[fan.model0_ventilation-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': dict({
'preset_modes': list([
<VentilationMode.PERMANENT: 'permanent'>,
<VentilationMode.VENTILATION: 'ventilation'>,
<VentilationMode.SENSOR_DRIVEN: 'sensor_driven'>,
<VentilationMode.SENSOR_OVERRIDE: 'sensor_override'>,
]),
}),
'config_entry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'fan',
'entity_category': None,
'entity_id': 'fan.model0_ventilation',
'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': 'Ventilation',
'platform': 'vicare',
'previous_unique_id': None,
'supported_features': <FanEntityFeature: 9>,
'translation_key': 'ventilation',
'unique_id': 'gateway0-ventilation',
'unit_of_measurement': None,
})
# ---
# name: test_all_entities[fan.model0_ventilation-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'friendly_name': 'model0 Ventilation',
'percentage': 0,
'percentage_step': 25.0,
'preset_mode': None,
'preset_modes': list([
<VentilationMode.PERMANENT: 'permanent'>,
<VentilationMode.VENTILATION: 'ventilation'>,
<VentilationMode.SENSOR_DRIVEN: 'sensor_driven'>,
<VentilationMode.SENSOR_OVERRIDE: 'sensor_override'>,
]),
'supported_features': <FanEntityFeature: 9>,
}),
'context': <ANY>,
'entity_id': 'fan.model0_ventilation',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'on',
})
# ---

View File

@ -0,0 +1,567 @@
# serializer version: 1
# name: test_all_entities[number.model0_comfort_temperature-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': dict({
'max': 100.0,
'min': 0.0,
'mode': <NumberMode.AUTO: 'auto'>,
'step': 1.0,
}),
'config_entry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'number',
'entity_category': <EntityCategory.CONFIG: 'config'>,
'entity_id': 'number.model0_comfort_temperature',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'options': dict({
}),
'original_device_class': <NumberDeviceClass.TEMPERATURE: 'temperature'>,
'original_icon': None,
'original_name': 'Comfort temperature',
'platform': 'vicare',
'previous_unique_id': None,
'supported_features': 0,
'translation_key': 'comfort_temperature',
'unique_id': 'gateway0-comfort_temperature-0',
'unit_of_measurement': <UnitOfTemperature.CELSIUS: '°C'>,
})
# ---
# name: test_all_entities[number.model0_comfort_temperature-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'temperature',
'friendly_name': 'model0 Comfort temperature',
'max': 100.0,
'min': 0.0,
'mode': <NumberMode.AUTO: 'auto'>,
'step': 1.0,
'unit_of_measurement': <UnitOfTemperature.CELSIUS: '°C'>,
}),
'context': <ANY>,
'entity_id': 'number.model0_comfort_temperature',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'unavailable',
})
# ---
# name: test_all_entities[number.model0_comfort_temperature_2-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': dict({
'max': 100.0,
'min': 0.0,
'mode': <NumberMode.AUTO: 'auto'>,
'step': 1.0,
}),
'config_entry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'number',
'entity_category': <EntityCategory.CONFIG: 'config'>,
'entity_id': 'number.model0_comfort_temperature_2',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'options': dict({
}),
'original_device_class': <NumberDeviceClass.TEMPERATURE: 'temperature'>,
'original_icon': None,
'original_name': 'Comfort temperature',
'platform': 'vicare',
'previous_unique_id': None,
'supported_features': 0,
'translation_key': 'comfort_temperature',
'unique_id': 'gateway0-comfort_temperature-1',
'unit_of_measurement': <UnitOfTemperature.CELSIUS: '°C'>,
})
# ---
# name: test_all_entities[number.model0_comfort_temperature_2-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'temperature',
'friendly_name': 'model0 Comfort temperature',
'max': 100.0,
'min': 0.0,
'mode': <NumberMode.AUTO: 'auto'>,
'step': 1.0,
'unit_of_measurement': <UnitOfTemperature.CELSIUS: '°C'>,
}),
'context': <ANY>,
'entity_id': 'number.model0_comfort_temperature_2',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'unavailable',
})
# ---
# name: test_all_entities[number.model0_heating_curve_shift-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': dict({
'max': 40,
'min': -13,
'mode': <NumberMode.AUTO: 'auto'>,
'step': 1,
}),
'config_entry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'number',
'entity_category': <EntityCategory.CONFIG: 'config'>,
'entity_id': 'number.model0_heating_curve_shift',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'options': dict({
}),
'original_device_class': <NumberDeviceClass.TEMPERATURE: 'temperature'>,
'original_icon': None,
'original_name': 'Heating curve shift',
'platform': 'vicare',
'previous_unique_id': None,
'supported_features': 0,
'translation_key': 'heating_curve_shift',
'unique_id': 'gateway0-heating curve shift-0',
'unit_of_measurement': <UnitOfTemperature.CELSIUS: '°C'>,
})
# ---
# name: test_all_entities[number.model0_heating_curve_shift-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'temperature',
'friendly_name': 'model0 Heating curve shift',
'max': 40,
'min': -13,
'mode': <NumberMode.AUTO: 'auto'>,
'step': 1,
'unit_of_measurement': <UnitOfTemperature.CELSIUS: '°C'>,
}),
'context': <ANY>,
'entity_id': 'number.model0_heating_curve_shift',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'unavailable',
})
# ---
# name: test_all_entities[number.model0_heating_curve_shift_2-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': dict({
'max': 40,
'min': -13,
'mode': <NumberMode.AUTO: 'auto'>,
'step': 1,
}),
'config_entry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'number',
'entity_category': <EntityCategory.CONFIG: 'config'>,
'entity_id': 'number.model0_heating_curve_shift_2',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'options': dict({
}),
'original_device_class': <NumberDeviceClass.TEMPERATURE: 'temperature'>,
'original_icon': None,
'original_name': 'Heating curve shift',
'platform': 'vicare',
'previous_unique_id': None,
'supported_features': 0,
'translation_key': 'heating_curve_shift',
'unique_id': 'gateway0-heating curve shift-1',
'unit_of_measurement': <UnitOfTemperature.CELSIUS: '°C'>,
})
# ---
# name: test_all_entities[number.model0_heating_curve_shift_2-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'temperature',
'friendly_name': 'model0 Heating curve shift',
'max': 40,
'min': -13,
'mode': <NumberMode.AUTO: 'auto'>,
'step': 1,
'unit_of_measurement': <UnitOfTemperature.CELSIUS: '°C'>,
}),
'context': <ANY>,
'entity_id': 'number.model0_heating_curve_shift_2',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'unavailable',
})
# ---
# name: test_all_entities[number.model0_heating_curve_slope-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': dict({
'max': 3.5,
'min': 0.2,
'mode': <NumberMode.AUTO: 'auto'>,
'step': 0.1,
}),
'config_entry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'number',
'entity_category': <EntityCategory.CONFIG: 'config'>,
'entity_id': 'number.model0_heating_curve_slope',
'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': 'Heating curve slope',
'platform': 'vicare',
'previous_unique_id': None,
'supported_features': 0,
'translation_key': 'heating_curve_slope',
'unique_id': 'gateway0-heating curve slope-0',
'unit_of_measurement': None,
})
# ---
# name: test_all_entities[number.model0_heating_curve_slope-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'friendly_name': 'model0 Heating curve slope',
'max': 3.5,
'min': 0.2,
'mode': <NumberMode.AUTO: 'auto'>,
'step': 0.1,
}),
'context': <ANY>,
'entity_id': 'number.model0_heating_curve_slope',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'unavailable',
})
# ---
# name: test_all_entities[number.model0_heating_curve_slope_2-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': dict({
'max': 3.5,
'min': 0.2,
'mode': <NumberMode.AUTO: 'auto'>,
'step': 0.1,
}),
'config_entry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'number',
'entity_category': <EntityCategory.CONFIG: 'config'>,
'entity_id': 'number.model0_heating_curve_slope_2',
'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': 'Heating curve slope',
'platform': 'vicare',
'previous_unique_id': None,
'supported_features': 0,
'translation_key': 'heating_curve_slope',
'unique_id': 'gateway0-heating curve slope-1',
'unit_of_measurement': None,
})
# ---
# name: test_all_entities[number.model0_heating_curve_slope_2-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'friendly_name': 'model0 Heating curve slope',
'max': 3.5,
'min': 0.2,
'mode': <NumberMode.AUTO: 'auto'>,
'step': 0.1,
}),
'context': <ANY>,
'entity_id': 'number.model0_heating_curve_slope_2',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'unavailable',
})
# ---
# name: test_all_entities[number.model0_normal_temperature-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': dict({
'max': 100.0,
'min': 0.0,
'mode': <NumberMode.AUTO: 'auto'>,
'step': 1.0,
}),
'config_entry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'number',
'entity_category': <EntityCategory.CONFIG: 'config'>,
'entity_id': 'number.model0_normal_temperature',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'options': dict({
}),
'original_device_class': <NumberDeviceClass.TEMPERATURE: 'temperature'>,
'original_icon': None,
'original_name': 'Normal temperature',
'platform': 'vicare',
'previous_unique_id': None,
'supported_features': 0,
'translation_key': 'normal_temperature',
'unique_id': 'gateway0-normal_temperature-0',
'unit_of_measurement': <UnitOfTemperature.CELSIUS: '°C'>,
})
# ---
# name: test_all_entities[number.model0_normal_temperature-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'temperature',
'friendly_name': 'model0 Normal temperature',
'max': 100.0,
'min': 0.0,
'mode': <NumberMode.AUTO: 'auto'>,
'step': 1.0,
'unit_of_measurement': <UnitOfTemperature.CELSIUS: '°C'>,
}),
'context': <ANY>,
'entity_id': 'number.model0_normal_temperature',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'unavailable',
})
# ---
# name: test_all_entities[number.model0_normal_temperature_2-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': dict({
'max': 100.0,
'min': 0.0,
'mode': <NumberMode.AUTO: 'auto'>,
'step': 1.0,
}),
'config_entry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'number',
'entity_category': <EntityCategory.CONFIG: 'config'>,
'entity_id': 'number.model0_normal_temperature_2',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'options': dict({
}),
'original_device_class': <NumberDeviceClass.TEMPERATURE: 'temperature'>,
'original_icon': None,
'original_name': 'Normal temperature',
'platform': 'vicare',
'previous_unique_id': None,
'supported_features': 0,
'translation_key': 'normal_temperature',
'unique_id': 'gateway0-normal_temperature-1',
'unit_of_measurement': <UnitOfTemperature.CELSIUS: '°C'>,
})
# ---
# name: test_all_entities[number.model0_normal_temperature_2-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'temperature',
'friendly_name': 'model0 Normal temperature',
'max': 100.0,
'min': 0.0,
'mode': <NumberMode.AUTO: 'auto'>,
'step': 1.0,
'unit_of_measurement': <UnitOfTemperature.CELSIUS: '°C'>,
}),
'context': <ANY>,
'entity_id': 'number.model0_normal_temperature_2',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'unavailable',
})
# ---
# name: test_all_entities[number.model0_reduced_temperature-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': dict({
'max': 100.0,
'min': 0.0,
'mode': <NumberMode.AUTO: 'auto'>,
'step': 1.0,
}),
'config_entry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'number',
'entity_category': <EntityCategory.CONFIG: 'config'>,
'entity_id': 'number.model0_reduced_temperature',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'options': dict({
}),
'original_device_class': <NumberDeviceClass.TEMPERATURE: 'temperature'>,
'original_icon': None,
'original_name': 'Reduced temperature',
'platform': 'vicare',
'previous_unique_id': None,
'supported_features': 0,
'translation_key': 'reduced_temperature',
'unique_id': 'gateway0-reduced_temperature-0',
'unit_of_measurement': <UnitOfTemperature.CELSIUS: '°C'>,
})
# ---
# name: test_all_entities[number.model0_reduced_temperature-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'temperature',
'friendly_name': 'model0 Reduced temperature',
'max': 100.0,
'min': 0.0,
'mode': <NumberMode.AUTO: 'auto'>,
'step': 1.0,
'unit_of_measurement': <UnitOfTemperature.CELSIUS: '°C'>,
}),
'context': <ANY>,
'entity_id': 'number.model0_reduced_temperature',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'unavailable',
})
# ---
# name: test_all_entities[number.model0_reduced_temperature_2-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': dict({
'max': 100.0,
'min': 0.0,
'mode': <NumberMode.AUTO: 'auto'>,
'step': 1.0,
}),
'config_entry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'number',
'entity_category': <EntityCategory.CONFIG: 'config'>,
'entity_id': 'number.model0_reduced_temperature_2',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'options': dict({
}),
'original_device_class': <NumberDeviceClass.TEMPERATURE: 'temperature'>,
'original_icon': None,
'original_name': 'Reduced temperature',
'platform': 'vicare',
'previous_unique_id': None,
'supported_features': 0,
'translation_key': 'reduced_temperature',
'unique_id': 'gateway0-reduced_temperature-1',
'unit_of_measurement': <UnitOfTemperature.CELSIUS: '°C'>,
})
# ---
# name: test_all_entities[number.model0_reduced_temperature_2-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'temperature',
'friendly_name': 'model0 Reduced temperature',
'max': 100.0,
'min': 0.0,
'mode': <NumberMode.AUTO: 'auto'>,
'step': 1.0,
'unit_of_measurement': <UnitOfTemperature.CELSIUS: '°C'>,
}),
'context': <ANY>,
'entity_id': 'number.model0_reduced_temperature_2',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'unavailable',
})
# ---

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,113 @@
# serializer version: 1
# name: test_all_entities[water_heater.model0_domestic_hot_water-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': dict({
'max_temp': 60,
'min_temp': 10,
}),
'config_entry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'water_heater',
'entity_category': None,
'entity_id': 'water_heater.model0_domestic_hot_water',
'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': 'Domestic hot water',
'platform': 'vicare',
'previous_unique_id': None,
'supported_features': <WaterHeaterEntityFeature: 1>,
'translation_key': 'domestic_hot_water',
'unique_id': 'gateway0-0',
'unit_of_measurement': None,
})
# ---
# name: test_all_entities[water_heater.model0_domestic_hot_water-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'current_temperature': None,
'friendly_name': 'model0 Domestic hot water',
'max_temp': 60,
'min_temp': 10,
'supported_features': <WaterHeaterEntityFeature: 1>,
'target_temp_high': None,
'target_temp_low': None,
'temperature': None,
}),
'context': <ANY>,
'entity_id': 'water_heater.model0_domestic_hot_water',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'unknown',
})
# ---
# name: test_all_entities[water_heater.model0_domestic_hot_water_2-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': dict({
'max_temp': 60,
'min_temp': 10,
}),
'config_entry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'water_heater',
'entity_category': None,
'entity_id': 'water_heater.model0_domestic_hot_water_2',
'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': 'Domestic hot water',
'platform': 'vicare',
'previous_unique_id': None,
'supported_features': <WaterHeaterEntityFeature: 1>,
'translation_key': 'domestic_hot_water',
'unique_id': 'gateway0-1',
'unit_of_measurement': None,
})
# ---
# name: test_all_entities[water_heater.model0_domestic_hot_water_2-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'current_temperature': None,
'friendly_name': 'model0 Domestic hot water',
'max_temp': 60,
'min_temp': 10,
'supported_features': <WaterHeaterEntityFeature: 1>,
'target_temp_high': None,
'target_temp_low': None,
'temperature': None,
}),
'context': <ANY>,
'entity_id': 'water_heater.model0_domestic_hot_water_2',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'unknown',
})
# ---

View File

@ -1,11 +1,18 @@
"""Test ViCare binary sensors.""" """Test ViCare binary sensors."""
from unittest.mock import MagicMock from unittest.mock import MagicMock, patch
import pytest import pytest
from syrupy.assertion import SnapshotAssertion from syrupy.assertion import SnapshotAssertion
from homeassistant.const import Platform
from homeassistant.core import HomeAssistant from homeassistant.core import HomeAssistant
from homeassistant.helpers import entity_registry as er
from . import MODULE, setup_integration
from .conftest import Fixture, MockPyViCare
from tests.common import MockConfigEntry, snapshot_platform
@pytest.mark.parametrize( @pytest.mark.parametrize(
@ -24,3 +31,21 @@ async def test_binary_sensors(
) -> None: ) -> None:
"""Test the ViCare binary sensor.""" """Test the ViCare binary sensor."""
assert hass.states.get(f"binary_sensor.model0_{entity_id}") == snapshot assert hass.states.get(f"binary_sensor.model0_{entity_id}") == snapshot
@pytest.mark.usefixtures("entity_registry_enabled_by_default")
async def test_all_entities(
hass: HomeAssistant,
snapshot: SnapshotAssertion,
mock_config_entry: MockConfigEntry,
entity_registry: er.EntityRegistry,
) -> None:
"""Test all entities."""
fixtures: list[Fixture] = [Fixture({"type:boiler"}, "vicare/Vitodens300W.json")]
with (
patch(f"{MODULE}.vicare_login", return_value=MockPyViCare(fixtures)),
patch(f"{MODULE}.PLATFORMS", [Platform.BINARY_SENSOR]),
):
await setup_integration(hass, mock_config_entry)
await snapshot_platform(hass, entity_registry, snapshot, mock_config_entry.entry_id)

View File

@ -0,0 +1,33 @@
"""Test ViCare button entity."""
from unittest.mock import patch
import pytest
from syrupy.assertion import SnapshotAssertion
from homeassistant.const import Platform
from homeassistant.core import HomeAssistant
from homeassistant.helpers import entity_registry as er
from . import MODULE, setup_integration
from .conftest import Fixture, MockPyViCare
from tests.common import MockConfigEntry, snapshot_platform
@pytest.mark.usefixtures("entity_registry_enabled_by_default")
async def test_all_entities(
hass: HomeAssistant,
snapshot: SnapshotAssertion,
mock_config_entry: MockConfigEntry,
entity_registry: er.EntityRegistry,
) -> None:
"""Test all entities."""
fixtures: list[Fixture] = [Fixture({"type:boiler"}, "vicare/Vitodens300W.json")]
with (
patch(f"{MODULE}.vicare_login", return_value=MockPyViCare(fixtures)),
patch(f"{MODULE}.PLATFORMS", [Platform.BUTTON]),
):
await setup_integration(hass, mock_config_entry)
await snapshot_platform(hass, entity_registry, snapshot, mock_config_entry.entry_id)

View File

@ -0,0 +1,33 @@
"""Test ViCare climate entity."""
from unittest.mock import patch
import pytest
from syrupy.assertion import SnapshotAssertion
from homeassistant.const import Platform
from homeassistant.core import HomeAssistant
from homeassistant.helpers import entity_registry as er
from . import MODULE, setup_integration
from .conftest import Fixture, MockPyViCare
from tests.common import MockConfigEntry, snapshot_platform
@pytest.mark.usefixtures("entity_registry_enabled_by_default")
async def test_all_entities(
hass: HomeAssistant,
snapshot: SnapshotAssertion,
mock_config_entry: MockConfigEntry,
entity_registry: er.EntityRegistry,
) -> None:
"""Test all entities."""
fixtures: list[Fixture] = [Fixture({"type:boiler"}, "vicare/Vitodens300W.json")]
with (
patch(f"{MODULE}.vicare_login", return_value=MockPyViCare(fixtures)),
patch(f"{MODULE}.PLATFORMS", [Platform.CLIMATE]),
):
await setup_integration(hass, mock_config_entry)
await snapshot_platform(hass, entity_registry, snapshot, mock_config_entry.entry_id)

View File

@ -0,0 +1,33 @@
"""Test ViCare fan."""
from unittest.mock import patch
import pytest
from syrupy.assertion import SnapshotAssertion
from homeassistant.const import Platform
from homeassistant.core import HomeAssistant
from homeassistant.helpers import entity_registry as er
from . import MODULE, setup_integration
from .conftest import Fixture, MockPyViCare
from tests.common import MockConfigEntry, snapshot_platform
@pytest.mark.usefixtures("entity_registry_enabled_by_default")
async def test_all_entities(
hass: HomeAssistant,
snapshot: SnapshotAssertion,
mock_config_entry: MockConfigEntry,
entity_registry: er.EntityRegistry,
) -> None:
"""Test all entities."""
fixtures: list[Fixture] = [Fixture({"type:ventilation"}, "vicare/ViAir300F.json")]
with (
patch(f"{MODULE}.vicare_login", return_value=MockPyViCare(fixtures)),
patch(f"{MODULE}.PLATFORMS", [Platform.FAN]),
):
await setup_integration(hass, mock_config_entry)
await snapshot_platform(hass, entity_registry, snapshot, mock_config_entry.entry_id)

View File

@ -0,0 +1,33 @@
"""Test ViCare number entity."""
from unittest.mock import patch
import pytest
from syrupy.assertion import SnapshotAssertion
from homeassistant.const import Platform
from homeassistant.core import HomeAssistant
from homeassistant.helpers import entity_registry as er
from . import MODULE, setup_integration
from .conftest import Fixture, MockPyViCare
from tests.common import MockConfigEntry, snapshot_platform
@pytest.mark.usefixtures("entity_registry_enabled_by_default")
async def test_all_entities(
hass: HomeAssistant,
snapshot: SnapshotAssertion,
mock_config_entry: MockConfigEntry,
entity_registry: er.EntityRegistry,
) -> None:
"""Test all entities."""
fixtures: list[Fixture] = [Fixture({"type:boiler"}, "vicare/Vitodens300W.json")]
with (
patch(f"{MODULE}.vicare_login", return_value=MockPyViCare(fixtures)),
patch(f"{MODULE}.PLATFORMS", [Platform.NUMBER]),
):
await setup_integration(hass, mock_config_entry)
await snapshot_platform(hass, entity_registry, snapshot, mock_config_entry.entry_id)

View File

@ -0,0 +1,33 @@
"""Test ViCare sensor entity."""
from unittest.mock import patch
import pytest
from syrupy.assertion import SnapshotAssertion
from homeassistant.const import Platform
from homeassistant.core import HomeAssistant
from homeassistant.helpers import entity_registry as er
from . import MODULE, setup_integration
from .conftest import Fixture, MockPyViCare
from tests.common import MockConfigEntry, snapshot_platform
@pytest.mark.usefixtures("entity_registry_enabled_by_default")
async def test_all_entities(
hass: HomeAssistant,
snapshot: SnapshotAssertion,
mock_config_entry: MockConfigEntry,
entity_registry: er.EntityRegistry,
) -> None:
"""Test all entities."""
fixtures: list[Fixture] = [Fixture({"type:boiler"}, "vicare/Vitodens300W.json")]
with (
patch(f"{MODULE}.vicare_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)

View File

@ -0,0 +1,33 @@
"""Test ViCare water heater entity."""
from unittest.mock import patch
import pytest
from syrupy.assertion import SnapshotAssertion
from homeassistant.const import Platform
from homeassistant.core import HomeAssistant
from homeassistant.helpers import entity_registry as er
from . import MODULE, setup_integration
from .conftest import Fixture, MockPyViCare
from tests.common import MockConfigEntry, snapshot_platform
@pytest.mark.usefixtures("entity_registry_enabled_by_default")
async def test_all_entities(
hass: HomeAssistant,
snapshot: SnapshotAssertion,
mock_config_entry: MockConfigEntry,
entity_registry: er.EntityRegistry,
) -> None:
"""Test all entities."""
fixtures: list[Fixture] = [Fixture({"type:boiler"}, "vicare/Vitodens300W.json")]
with (
patch(f"{MODULE}.vicare_login", return_value=MockPyViCare(fixtures)),
patch(f"{MODULE}.PLATFORMS", [Platform.WATER_HEATER]),
):
await setup_integration(hass, mock_config_entry)
await snapshot_platform(hass, entity_registry, snapshot, mock_config_entry.entry_id)