mirror of
https://github.com/home-assistant/core.git
synced 2026-05-27 19:25:18 +02:00
Compare commits
34 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 0a8a1ff345 | |||
| 43b2e26993 | |||
| 68bea745d4 | |||
| 9f876757f6 | |||
| 28f70fab8d | |||
| 289490faa3 | |||
| dea46f7b2e | |||
| 82e3221126 | |||
| 47e8fbc1ed | |||
| 0428d0b97f | |||
| 45344c04c1 | |||
| c472b6ac5e | |||
| 58f533feb6 | |||
| 0af8c8fd8c | |||
| b9d6c3b9fe | |||
| b700940bb9 | |||
| 3b73f6d37e | |||
| 2812bb21da | |||
| 5d474675e8 | |||
| ea7bcf6cda | |||
| 725bd3d671 | |||
| cfc4fa6342 | |||
| b650e71660 | |||
| 9ddf15e348 | |||
| 15082f9111 | |||
| 12f16611ff | |||
| 8041be3d08 | |||
| 40b021e755 | |||
| aab57eda96 | |||
| f0dd37caa5 | |||
| 662b178495 | |||
| cb3d30884a | |||
| 49e6f20372 | |||
| 75d02661eb |
@@ -140,6 +140,14 @@
|
|||||||
"pump_status": {
|
"pump_status": {
|
||||||
"default": "mdi:pump"
|
"default": "mdi:pump"
|
||||||
},
|
},
|
||||||
|
"setpoint_change_source": {
|
||||||
|
"default": "mdi:hand-back-right",
|
||||||
|
"state": {
|
||||||
|
"external": "mdi:webhook",
|
||||||
|
"manual": "mdi:hand-back-right",
|
||||||
|
"schedule": "mdi:calendar-clock"
|
||||||
|
}
|
||||||
|
},
|
||||||
"tank_percentage": {
|
"tank_percentage": {
|
||||||
"default": "mdi:water-boiler"
|
"default": "mdi:water-boiler"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -183,6 +183,13 @@ EVSE_FAULT_STATE_MAP = {
|
|||||||
clusters.EnergyEvse.Enums.FaultStateEnum.kOther: "other",
|
clusters.EnergyEvse.Enums.FaultStateEnum.kOther: "other",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SETPOINT_CHANGE_SOURCE_MAP = {
|
||||||
|
clusters.Thermostat.Enums.SetpointChangeSourceEnum.kManual: "manual",
|
||||||
|
clusters.Thermostat.Enums.SetpointChangeSourceEnum.kSchedule: "schedule",
|
||||||
|
clusters.Thermostat.Enums.SetpointChangeSourceEnum.kExternal: "external",
|
||||||
|
clusters.Thermostat.Enums.SetpointChangeSourceEnum.kUnknownEnumValue: None,
|
||||||
|
}
|
||||||
|
|
||||||
PUMP_CONTROL_MODE_MAP = {
|
PUMP_CONTROL_MODE_MAP = {
|
||||||
clusters.PumpConfigurationAndControl.Enums.ControlModeEnum.kConstantSpeed: "constant_speed",
|
clusters.PumpConfigurationAndControl.Enums.ControlModeEnum.kConstantSpeed: "constant_speed",
|
||||||
clusters.PumpConfigurationAndControl.Enums.ControlModeEnum.kConstantPressure: "constant_pressure",
|
clusters.PumpConfigurationAndControl.Enums.ControlModeEnum.kConstantPressure: "constant_pressure",
|
||||||
@@ -1579,4 +1586,48 @@ DISCOVERY_SCHEMAS = [
|
|||||||
required_attributes=(clusters.DoorLock.Attributes.DoorClosedEvents,),
|
required_attributes=(clusters.DoorLock.Attributes.DoorClosedEvents,),
|
||||||
featuremap_contains=clusters.DoorLock.Bitmaps.Feature.kDoorPositionSensor,
|
featuremap_contains=clusters.DoorLock.Bitmaps.Feature.kDoorPositionSensor,
|
||||||
),
|
),
|
||||||
|
MatterDiscoverySchema(
|
||||||
|
platform=Platform.SENSOR,
|
||||||
|
entity_description=MatterSensorEntityDescription(
|
||||||
|
key="SetpointChangeSource",
|
||||||
|
translation_key="setpoint_change_source",
|
||||||
|
device_class=SensorDeviceClass.ENUM,
|
||||||
|
state_class=None,
|
||||||
|
options=[x for x in SETPOINT_CHANGE_SOURCE_MAP.values() if x is not None],
|
||||||
|
device_to_ha=SETPOINT_CHANGE_SOURCE_MAP.get,
|
||||||
|
),
|
||||||
|
entity_class=MatterSensor,
|
||||||
|
required_attributes=(clusters.Thermostat.Attributes.SetpointChangeSource,),
|
||||||
|
device_type=(device_types.Thermostat, device_types.RoomAirConditioner),
|
||||||
|
),
|
||||||
|
MatterDiscoverySchema(
|
||||||
|
platform=Platform.SENSOR,
|
||||||
|
entity_description=MatterSensorEntityDescription(
|
||||||
|
key="SetpointChangeSourceTimestamp",
|
||||||
|
translation_key="setpoint_change_timestamp",
|
||||||
|
device_class=SensorDeviceClass.TIMESTAMP,
|
||||||
|
state_class=None,
|
||||||
|
device_to_ha=matter_epoch_seconds_to_utc,
|
||||||
|
),
|
||||||
|
entity_class=MatterSensor,
|
||||||
|
required_attributes=(
|
||||||
|
clusters.Thermostat.Attributes.SetpointChangeSourceTimestamp,
|
||||||
|
),
|
||||||
|
device_type=(device_types.Thermostat, device_types.RoomAirConditioner),
|
||||||
|
),
|
||||||
|
MatterDiscoverySchema(
|
||||||
|
platform=Platform.SENSOR,
|
||||||
|
entity_description=MatterSensorEntityDescription(
|
||||||
|
key="ThermostatSetpointChangeAmount",
|
||||||
|
translation_key="setpoint_change_amount",
|
||||||
|
native_unit_of_measurement=UnitOfTemperature.CELSIUS,
|
||||||
|
suggested_display_precision=1,
|
||||||
|
device_class=SensorDeviceClass.TEMPERATURE,
|
||||||
|
device_to_ha=lambda x: x / TEMPERATURE_SCALING_FACTOR,
|
||||||
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
|
),
|
||||||
|
entity_class=MatterSensor,
|
||||||
|
required_attributes=(clusters.Thermostat.Attributes.SetpointChangeAmount,),
|
||||||
|
device_type=(device_types.Thermostat, device_types.RoomAirConditioner),
|
||||||
|
),
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -558,6 +558,20 @@
|
|||||||
"rms_voltage": {
|
"rms_voltage": {
|
||||||
"name": "Effective voltage"
|
"name": "Effective voltage"
|
||||||
},
|
},
|
||||||
|
"setpoint_change_amount": {
|
||||||
|
"name": "Last change amount"
|
||||||
|
},
|
||||||
|
"setpoint_change_source": {
|
||||||
|
"name": "Last change source",
|
||||||
|
"state": {
|
||||||
|
"external": "External",
|
||||||
|
"manual": "Manual",
|
||||||
|
"schedule": "Schedule"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"setpoint_change_timestamp": {
|
||||||
|
"name": "Last change"
|
||||||
|
},
|
||||||
"switch_current_position": {
|
"switch_current_position": {
|
||||||
"name": "Current switch position"
|
"name": "Current switch position"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -4145,6 +4145,177 @@
|
|||||||
'state': '100',
|
'state': '100',
|
||||||
})
|
})
|
||||||
# ---
|
# ---
|
||||||
|
# name: test_sensors[eve_thermo_v5][sensor.eve_thermo_20ecd1701_last_change-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': 'sensor',
|
||||||
|
'entity_category': None,
|
||||||
|
'entity_id': 'sensor.eve_thermo_20ecd1701_last_change',
|
||||||
|
'has_entity_name': True,
|
||||||
|
'hidden_by': None,
|
||||||
|
'icon': None,
|
||||||
|
'id': <ANY>,
|
||||||
|
'labels': set({
|
||||||
|
}),
|
||||||
|
'name': None,
|
||||||
|
'object_id_base': 'Last change',
|
||||||
|
'options': dict({
|
||||||
|
}),
|
||||||
|
'original_device_class': <SensorDeviceClass.TIMESTAMP: 'timestamp'>,
|
||||||
|
'original_icon': None,
|
||||||
|
'original_name': 'Last change',
|
||||||
|
'platform': 'matter',
|
||||||
|
'previous_unique_id': None,
|
||||||
|
'suggested_object_id': None,
|
||||||
|
'supported_features': 0,
|
||||||
|
'translation_key': 'setpoint_change_timestamp',
|
||||||
|
'unique_id': '00000000000004D2-000000000000000C-MatterNodeDevice-1-SetpointChangeSourceTimestamp-513-50',
|
||||||
|
'unit_of_measurement': None,
|
||||||
|
})
|
||||||
|
# ---
|
||||||
|
# name: test_sensors[eve_thermo_v5][sensor.eve_thermo_20ecd1701_last_change-state]
|
||||||
|
StateSnapshot({
|
||||||
|
'attributes': ReadOnlyDict({
|
||||||
|
'device_class': 'timestamp',
|
||||||
|
'friendly_name': 'Eve Thermo 20ECD1701 Last change',
|
||||||
|
}),
|
||||||
|
'context': <ANY>,
|
||||||
|
'entity_id': 'sensor.eve_thermo_20ecd1701_last_change',
|
||||||
|
'last_changed': <ANY>,
|
||||||
|
'last_reported': <ANY>,
|
||||||
|
'last_updated': <ANY>,
|
||||||
|
'state': 'unknown',
|
||||||
|
})
|
||||||
|
# ---
|
||||||
|
# name: test_sensors[eve_thermo_v5][sensor.eve_thermo_20ecd1701_last_change_amount-entry]
|
||||||
|
EntityRegistryEntrySnapshot({
|
||||||
|
'aliases': list([
|
||||||
|
None,
|
||||||
|
]),
|
||||||
|
'area_id': None,
|
||||||
|
'capabilities': dict({
|
||||||
|
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
|
||||||
|
}),
|
||||||
|
'config_entry_id': <ANY>,
|
||||||
|
'config_subentry_id': <ANY>,
|
||||||
|
'device_class': None,
|
||||||
|
'device_id': <ANY>,
|
||||||
|
'disabled_by': None,
|
||||||
|
'domain': 'sensor',
|
||||||
|
'entity_category': None,
|
||||||
|
'entity_id': 'sensor.eve_thermo_20ecd1701_last_change_amount',
|
||||||
|
'has_entity_name': True,
|
||||||
|
'hidden_by': None,
|
||||||
|
'icon': None,
|
||||||
|
'id': <ANY>,
|
||||||
|
'labels': set({
|
||||||
|
}),
|
||||||
|
'name': None,
|
||||||
|
'object_id_base': 'Last change amount',
|
||||||
|
'options': dict({
|
||||||
|
'sensor': dict({
|
||||||
|
'suggested_display_precision': 1,
|
||||||
|
}),
|
||||||
|
}),
|
||||||
|
'original_device_class': <SensorDeviceClass.TEMPERATURE: 'temperature'>,
|
||||||
|
'original_icon': None,
|
||||||
|
'original_name': 'Last change amount',
|
||||||
|
'platform': 'matter',
|
||||||
|
'previous_unique_id': None,
|
||||||
|
'suggested_object_id': None,
|
||||||
|
'supported_features': 0,
|
||||||
|
'translation_key': 'setpoint_change_amount',
|
||||||
|
'unique_id': '00000000000004D2-000000000000000C-MatterNodeDevice-1-ThermostatSetpointChangeAmount-513-49',
|
||||||
|
'unit_of_measurement': <UnitOfTemperature.CELSIUS: '°C'>,
|
||||||
|
})
|
||||||
|
# ---
|
||||||
|
# name: test_sensors[eve_thermo_v5][sensor.eve_thermo_20ecd1701_last_change_amount-state]
|
||||||
|
StateSnapshot({
|
||||||
|
'attributes': ReadOnlyDict({
|
||||||
|
'device_class': 'temperature',
|
||||||
|
'friendly_name': 'Eve Thermo 20ECD1701 Last change amount',
|
||||||
|
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
|
||||||
|
'unit_of_measurement': <UnitOfTemperature.CELSIUS: '°C'>,
|
||||||
|
}),
|
||||||
|
'context': <ANY>,
|
||||||
|
'entity_id': 'sensor.eve_thermo_20ecd1701_last_change_amount',
|
||||||
|
'last_changed': <ANY>,
|
||||||
|
'last_reported': <ANY>,
|
||||||
|
'last_updated': <ANY>,
|
||||||
|
'state': '0.0',
|
||||||
|
})
|
||||||
|
# ---
|
||||||
|
# name: test_sensors[eve_thermo_v5][sensor.eve_thermo_20ecd1701_last_change_source-entry]
|
||||||
|
EntityRegistryEntrySnapshot({
|
||||||
|
'aliases': list([
|
||||||
|
None,
|
||||||
|
]),
|
||||||
|
'area_id': None,
|
||||||
|
'capabilities': dict({
|
||||||
|
'options': list([
|
||||||
|
'manual',
|
||||||
|
'schedule',
|
||||||
|
'external',
|
||||||
|
]),
|
||||||
|
}),
|
||||||
|
'config_entry_id': <ANY>,
|
||||||
|
'config_subentry_id': <ANY>,
|
||||||
|
'device_class': None,
|
||||||
|
'device_id': <ANY>,
|
||||||
|
'disabled_by': None,
|
||||||
|
'domain': 'sensor',
|
||||||
|
'entity_category': None,
|
||||||
|
'entity_id': 'sensor.eve_thermo_20ecd1701_last_change_source',
|
||||||
|
'has_entity_name': True,
|
||||||
|
'hidden_by': None,
|
||||||
|
'icon': None,
|
||||||
|
'id': <ANY>,
|
||||||
|
'labels': set({
|
||||||
|
}),
|
||||||
|
'name': None,
|
||||||
|
'object_id_base': 'Last change source',
|
||||||
|
'options': dict({
|
||||||
|
}),
|
||||||
|
'original_device_class': <SensorDeviceClass.ENUM: 'enum'>,
|
||||||
|
'original_icon': None,
|
||||||
|
'original_name': 'Last change source',
|
||||||
|
'platform': 'matter',
|
||||||
|
'previous_unique_id': None,
|
||||||
|
'suggested_object_id': None,
|
||||||
|
'supported_features': 0,
|
||||||
|
'translation_key': 'setpoint_change_source',
|
||||||
|
'unique_id': '00000000000004D2-000000000000000C-MatterNodeDevice-1-SetpointChangeSource-513-48',
|
||||||
|
'unit_of_measurement': None,
|
||||||
|
})
|
||||||
|
# ---
|
||||||
|
# name: test_sensors[eve_thermo_v5][sensor.eve_thermo_20ecd1701_last_change_source-state]
|
||||||
|
StateSnapshot({
|
||||||
|
'attributes': ReadOnlyDict({
|
||||||
|
'device_class': 'enum',
|
||||||
|
'friendly_name': 'Eve Thermo 20ECD1701 Last change source',
|
||||||
|
'options': list([
|
||||||
|
'manual',
|
||||||
|
'schedule',
|
||||||
|
'external',
|
||||||
|
]),
|
||||||
|
}),
|
||||||
|
'context': <ANY>,
|
||||||
|
'entity_id': 'sensor.eve_thermo_20ecd1701_last_change_source',
|
||||||
|
'last_changed': <ANY>,
|
||||||
|
'last_reported': <ANY>,
|
||||||
|
'last_updated': <ANY>,
|
||||||
|
'state': 'manual',
|
||||||
|
})
|
||||||
|
# ---
|
||||||
# name: test_sensors[eve_thermo_v5][sensor.eve_thermo_20ecd1701_temperature-entry]
|
# name: test_sensors[eve_thermo_v5][sensor.eve_thermo_20ecd1701_temperature-entry]
|
||||||
EntityRegistryEntrySnapshot({
|
EntityRegistryEntrySnapshot({
|
||||||
'aliases': list([
|
'aliases': list([
|
||||||
@@ -11133,6 +11304,177 @@
|
|||||||
'state': '25',
|
'state': '25',
|
||||||
})
|
})
|
||||||
# ---
|
# ---
|
||||||
|
# name: test_sensors[mock_thermostat][sensor.mock_thermostat_last_change-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': 'sensor',
|
||||||
|
'entity_category': None,
|
||||||
|
'entity_id': 'sensor.mock_thermostat_last_change',
|
||||||
|
'has_entity_name': True,
|
||||||
|
'hidden_by': None,
|
||||||
|
'icon': None,
|
||||||
|
'id': <ANY>,
|
||||||
|
'labels': set({
|
||||||
|
}),
|
||||||
|
'name': None,
|
||||||
|
'object_id_base': 'Last change',
|
||||||
|
'options': dict({
|
||||||
|
}),
|
||||||
|
'original_device_class': <SensorDeviceClass.TIMESTAMP: 'timestamp'>,
|
||||||
|
'original_icon': None,
|
||||||
|
'original_name': 'Last change',
|
||||||
|
'platform': 'matter',
|
||||||
|
'previous_unique_id': None,
|
||||||
|
'suggested_object_id': None,
|
||||||
|
'supported_features': 0,
|
||||||
|
'translation_key': 'setpoint_change_timestamp',
|
||||||
|
'unique_id': '00000000000004D2-0000000000000096-MatterNodeDevice-1-SetpointChangeSourceTimestamp-513-50',
|
||||||
|
'unit_of_measurement': None,
|
||||||
|
})
|
||||||
|
# ---
|
||||||
|
# name: test_sensors[mock_thermostat][sensor.mock_thermostat_last_change-state]
|
||||||
|
StateSnapshot({
|
||||||
|
'attributes': ReadOnlyDict({
|
||||||
|
'device_class': 'timestamp',
|
||||||
|
'friendly_name': 'Mock Thermostat Last change',
|
||||||
|
}),
|
||||||
|
'context': <ANY>,
|
||||||
|
'entity_id': 'sensor.mock_thermostat_last_change',
|
||||||
|
'last_changed': <ANY>,
|
||||||
|
'last_reported': <ANY>,
|
||||||
|
'last_updated': <ANY>,
|
||||||
|
'state': '2025-01-01T00:00:00+00:00',
|
||||||
|
})
|
||||||
|
# ---
|
||||||
|
# name: test_sensors[mock_thermostat][sensor.mock_thermostat_last_change_amount-entry]
|
||||||
|
EntityRegistryEntrySnapshot({
|
||||||
|
'aliases': list([
|
||||||
|
None,
|
||||||
|
]),
|
||||||
|
'area_id': None,
|
||||||
|
'capabilities': dict({
|
||||||
|
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
|
||||||
|
}),
|
||||||
|
'config_entry_id': <ANY>,
|
||||||
|
'config_subentry_id': <ANY>,
|
||||||
|
'device_class': None,
|
||||||
|
'device_id': <ANY>,
|
||||||
|
'disabled_by': None,
|
||||||
|
'domain': 'sensor',
|
||||||
|
'entity_category': None,
|
||||||
|
'entity_id': 'sensor.mock_thermostat_last_change_amount',
|
||||||
|
'has_entity_name': True,
|
||||||
|
'hidden_by': None,
|
||||||
|
'icon': None,
|
||||||
|
'id': <ANY>,
|
||||||
|
'labels': set({
|
||||||
|
}),
|
||||||
|
'name': None,
|
||||||
|
'object_id_base': 'Last change amount',
|
||||||
|
'options': dict({
|
||||||
|
'sensor': dict({
|
||||||
|
'suggested_display_precision': 1,
|
||||||
|
}),
|
||||||
|
}),
|
||||||
|
'original_device_class': <SensorDeviceClass.TEMPERATURE: 'temperature'>,
|
||||||
|
'original_icon': None,
|
||||||
|
'original_name': 'Last change amount',
|
||||||
|
'platform': 'matter',
|
||||||
|
'previous_unique_id': None,
|
||||||
|
'suggested_object_id': None,
|
||||||
|
'supported_features': 0,
|
||||||
|
'translation_key': 'setpoint_change_amount',
|
||||||
|
'unique_id': '00000000000004D2-0000000000000096-MatterNodeDevice-1-ThermostatSetpointChangeAmount-513-49',
|
||||||
|
'unit_of_measurement': <UnitOfTemperature.CELSIUS: '°C'>,
|
||||||
|
})
|
||||||
|
# ---
|
||||||
|
# name: test_sensors[mock_thermostat][sensor.mock_thermostat_last_change_amount-state]
|
||||||
|
StateSnapshot({
|
||||||
|
'attributes': ReadOnlyDict({
|
||||||
|
'device_class': 'temperature',
|
||||||
|
'friendly_name': 'Mock Thermostat Last change amount',
|
||||||
|
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
|
||||||
|
'unit_of_measurement': <UnitOfTemperature.CELSIUS: '°C'>,
|
||||||
|
}),
|
||||||
|
'context': <ANY>,
|
||||||
|
'entity_id': 'sensor.mock_thermostat_last_change_amount',
|
||||||
|
'last_changed': <ANY>,
|
||||||
|
'last_reported': <ANY>,
|
||||||
|
'last_updated': <ANY>,
|
||||||
|
'state': '1.5',
|
||||||
|
})
|
||||||
|
# ---
|
||||||
|
# name: test_sensors[mock_thermostat][sensor.mock_thermostat_last_change_source-entry]
|
||||||
|
EntityRegistryEntrySnapshot({
|
||||||
|
'aliases': list([
|
||||||
|
None,
|
||||||
|
]),
|
||||||
|
'area_id': None,
|
||||||
|
'capabilities': dict({
|
||||||
|
'options': list([
|
||||||
|
'manual',
|
||||||
|
'schedule',
|
||||||
|
'external',
|
||||||
|
]),
|
||||||
|
}),
|
||||||
|
'config_entry_id': <ANY>,
|
||||||
|
'config_subentry_id': <ANY>,
|
||||||
|
'device_class': None,
|
||||||
|
'device_id': <ANY>,
|
||||||
|
'disabled_by': None,
|
||||||
|
'domain': 'sensor',
|
||||||
|
'entity_category': None,
|
||||||
|
'entity_id': 'sensor.mock_thermostat_last_change_source',
|
||||||
|
'has_entity_name': True,
|
||||||
|
'hidden_by': None,
|
||||||
|
'icon': None,
|
||||||
|
'id': <ANY>,
|
||||||
|
'labels': set({
|
||||||
|
}),
|
||||||
|
'name': None,
|
||||||
|
'object_id_base': 'Last change source',
|
||||||
|
'options': dict({
|
||||||
|
}),
|
||||||
|
'original_device_class': <SensorDeviceClass.ENUM: 'enum'>,
|
||||||
|
'original_icon': None,
|
||||||
|
'original_name': 'Last change source',
|
||||||
|
'platform': 'matter',
|
||||||
|
'previous_unique_id': None,
|
||||||
|
'suggested_object_id': None,
|
||||||
|
'supported_features': 0,
|
||||||
|
'translation_key': 'setpoint_change_source',
|
||||||
|
'unique_id': '00000000000004D2-0000000000000096-MatterNodeDevice-1-SetpointChangeSource-513-48',
|
||||||
|
'unit_of_measurement': None,
|
||||||
|
})
|
||||||
|
# ---
|
||||||
|
# name: test_sensors[mock_thermostat][sensor.mock_thermostat_last_change_source-state]
|
||||||
|
StateSnapshot({
|
||||||
|
'attributes': ReadOnlyDict({
|
||||||
|
'device_class': 'enum',
|
||||||
|
'friendly_name': 'Mock Thermostat Last change source',
|
||||||
|
'options': list([
|
||||||
|
'manual',
|
||||||
|
'schedule',
|
||||||
|
'external',
|
||||||
|
]),
|
||||||
|
}),
|
||||||
|
'context': <ANY>,
|
||||||
|
'entity_id': 'sensor.mock_thermostat_last_change_source',
|
||||||
|
'last_changed': <ANY>,
|
||||||
|
'last_reported': <ANY>,
|
||||||
|
'last_updated': <ANY>,
|
||||||
|
'state': 'manual',
|
||||||
|
})
|
||||||
|
# ---
|
||||||
# name: test_sensors[mock_thermostat][sensor.mock_thermostat_outdoor_temperature-entry]
|
# name: test_sensors[mock_thermostat][sensor.mock_thermostat_outdoor_temperature-entry]
|
||||||
EntityRegistryEntrySnapshot({
|
EntityRegistryEntrySnapshot({
|
||||||
'aliases': list([
|
'aliases': list([
|
||||||
|
|||||||
@@ -233,6 +233,100 @@ async def test_eve_thermo_sensor(
|
|||||||
assert state.state == "18.0"
|
assert state.state == "18.0"
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.parametrize("node_fixture", ["eve_thermo_v5"])
|
||||||
|
async def test_eve_thermo_v5_setpoint_change_source(
|
||||||
|
hass: HomeAssistant,
|
||||||
|
matter_client: MagicMock,
|
||||||
|
matter_node: MatterNode,
|
||||||
|
) -> None:
|
||||||
|
"""Test Eve Thermo v5 SetpointChangeSource sensor."""
|
||||||
|
entity_id = "sensor.eve_thermo_20ecd1701_last_change_source"
|
||||||
|
|
||||||
|
# Initial state and options
|
||||||
|
state = hass.states.get(entity_id)
|
||||||
|
assert state
|
||||||
|
assert state.state == "manual"
|
||||||
|
assert state.attributes["options"] == ["manual", "schedule", "external"]
|
||||||
|
|
||||||
|
# Change to schedule
|
||||||
|
set_node_attribute(matter_node, 1, 513, 48, 1)
|
||||||
|
await trigger_subscription_callback(hass, matter_client)
|
||||||
|
|
||||||
|
state = hass.states.get(entity_id)
|
||||||
|
assert state
|
||||||
|
assert state.state == "schedule"
|
||||||
|
|
||||||
|
# Change to external
|
||||||
|
set_node_attribute(matter_node, 1, 513, 48, 2)
|
||||||
|
await trigger_subscription_callback(hass, matter_client)
|
||||||
|
|
||||||
|
state = hass.states.get(entity_id)
|
||||||
|
assert state
|
||||||
|
assert state.state == "external"
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.parametrize("node_fixture", ["eve_thermo_v5"])
|
||||||
|
async def test_eve_thermo_v5_setpoint_change_timestamp(
|
||||||
|
hass: HomeAssistant,
|
||||||
|
matter_client: MagicMock,
|
||||||
|
matter_node: MatterNode,
|
||||||
|
) -> None:
|
||||||
|
"""Test Eve Thermo v5 SetpointChangeSourceTimestamp sensor."""
|
||||||
|
entity_id = "sensor.eve_thermo_20ecd1701_last_change"
|
||||||
|
|
||||||
|
# Initial is unknown per snapshot
|
||||||
|
state = hass.states.get(entity_id)
|
||||||
|
assert state
|
||||||
|
assert state.state == "unknown"
|
||||||
|
|
||||||
|
# Update to 2024-01-01 00:00:00+00:00 (Matter epoch seconds since 2000)
|
||||||
|
set_node_attribute(matter_node, 1, 513, 50, 757382400)
|
||||||
|
await trigger_subscription_callback(hass, matter_client)
|
||||||
|
|
||||||
|
state = hass.states.get(entity_id)
|
||||||
|
assert state
|
||||||
|
assert state.state == "2024-01-01T00:00:00+00:00"
|
||||||
|
|
||||||
|
# Set to zero should yield unknown
|
||||||
|
set_node_attribute(matter_node, 1, 513, 50, 0)
|
||||||
|
await trigger_subscription_callback(hass, matter_client)
|
||||||
|
|
||||||
|
state = hass.states.get(entity_id)
|
||||||
|
assert state
|
||||||
|
assert state.state == "unknown"
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.parametrize("node_fixture", ["eve_thermo_v5"])
|
||||||
|
async def test_eve_thermo_v5_setpoint_change_amount(
|
||||||
|
hass: HomeAssistant,
|
||||||
|
matter_client: MagicMock,
|
||||||
|
matter_node: MatterNode,
|
||||||
|
) -> None:
|
||||||
|
"""Test Eve Thermo v5 SetpointChangeAmount sensor."""
|
||||||
|
entity_id = "sensor.eve_thermo_20ecd1701_last_change_amount"
|
||||||
|
|
||||||
|
# Initial per snapshot
|
||||||
|
state = hass.states.get(entity_id)
|
||||||
|
assert state
|
||||||
|
assert state.state == "0.0"
|
||||||
|
|
||||||
|
# Update to 2.0°C (200 in Matter units)
|
||||||
|
set_node_attribute(matter_node, 1, 513, 49, 200)
|
||||||
|
await trigger_subscription_callback(hass, matter_client)
|
||||||
|
|
||||||
|
state = hass.states.get(entity_id)
|
||||||
|
assert state
|
||||||
|
assert state.state == "2.0"
|
||||||
|
|
||||||
|
# Update to -0.5°C (-50 in Matter units)
|
||||||
|
set_node_attribute(matter_node, 1, 513, 49, -50)
|
||||||
|
await trigger_subscription_callback(hass, matter_client)
|
||||||
|
|
||||||
|
state = hass.states.get(entity_id)
|
||||||
|
assert state
|
||||||
|
assert state.state == "-0.5"
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize("node_fixture", ["longan_link_thermostat"])
|
@pytest.mark.parametrize("node_fixture", ["longan_link_thermostat"])
|
||||||
async def test_thermostat_outdoor(
|
async def test_thermostat_outdoor(
|
||||||
hass: HomeAssistant,
|
hass: HomeAssistant,
|
||||||
|
|||||||
Reference in New Issue
Block a user