|
|
|
@ -0,0 +1,972 @@
|
|
|
|
|
# serializer version: 1
|
|
|
|
|
# name: test_sensors[sensor.energy_delivery_high-entry]
|
|
|
|
|
EntityRegistryEntrySnapshot({
|
|
|
|
|
'aliases': set({
|
|
|
|
|
}),
|
|
|
|
|
'area_id': None,
|
|
|
|
|
'capabilities': dict({
|
|
|
|
|
'state_class': <SensorStateClass.TOTAL_INCREASING: 'total_increasing'>,
|
|
|
|
|
}),
|
|
|
|
|
'config_entry_id': <ANY>,
|
|
|
|
|
'device_class': None,
|
|
|
|
|
'device_id': <ANY>,
|
|
|
|
|
'disabled_by': None,
|
|
|
|
|
'domain': 'sensor',
|
|
|
|
|
'entity_category': None,
|
|
|
|
|
'entity_id': 'sensor.energy_delivery_high',
|
|
|
|
|
'has_entity_name': False,
|
|
|
|
|
'hidden_by': None,
|
|
|
|
|
'icon': None,
|
|
|
|
|
'id': <ANY>,
|
|
|
|
|
'labels': set({
|
|
|
|
|
}),
|
|
|
|
|
'name': None,
|
|
|
|
|
'options': dict({
|
|
|
|
|
}),
|
|
|
|
|
'original_device_class': <SensorDeviceClass.ENERGY: 'energy'>,
|
|
|
|
|
'original_icon': None,
|
|
|
|
|
'original_name': 'Energy delivery high',
|
|
|
|
|
'platform': 'youless',
|
|
|
|
|
'previous_unique_id': None,
|
|
|
|
|
'supported_features': 0,
|
|
|
|
|
'translation_key': None,
|
|
|
|
|
'unique_id': 'youless_localhost_delivery_high',
|
|
|
|
|
'unit_of_measurement': <UnitOfEnergy.KILO_WATT_HOUR: 'kWh'>,
|
|
|
|
|
})
|
|
|
|
|
# ---
|
|
|
|
|
# name: test_sensors[sensor.energy_delivery_high-state]
|
|
|
|
|
StateSnapshot({
|
|
|
|
|
'attributes': ReadOnlyDict({
|
|
|
|
|
'device_class': 'energy',
|
|
|
|
|
'friendly_name': 'Energy delivery high',
|
|
|
|
|
'state_class': <SensorStateClass.TOTAL_INCREASING: 'total_increasing'>,
|
|
|
|
|
'unit_of_measurement': <UnitOfEnergy.KILO_WATT_HOUR: 'kWh'>,
|
|
|
|
|
}),
|
|
|
|
|
'context': <ANY>,
|
|
|
|
|
'entity_id': 'sensor.energy_delivery_high',
|
|
|
|
|
'last_changed': <ANY>,
|
|
|
|
|
'last_reported': <ANY>,
|
|
|
|
|
'last_updated': <ANY>,
|
|
|
|
|
'state': 'unavailable',
|
|
|
|
|
})
|
|
|
|
|
# ---
|
|
|
|
|
# name: test_sensors[sensor.energy_delivery_low-entry]
|
|
|
|
|
EntityRegistryEntrySnapshot({
|
|
|
|
|
'aliases': set({
|
|
|
|
|
}),
|
|
|
|
|
'area_id': None,
|
|
|
|
|
'capabilities': dict({
|
|
|
|
|
'state_class': <SensorStateClass.TOTAL_INCREASING: 'total_increasing'>,
|
|
|
|
|
}),
|
|
|
|
|
'config_entry_id': <ANY>,
|
|
|
|
|
'device_class': None,
|
|
|
|
|
'device_id': <ANY>,
|
|
|
|
|
'disabled_by': None,
|
|
|
|
|
'domain': 'sensor',
|
|
|
|
|
'entity_category': None,
|
|
|
|
|
'entity_id': 'sensor.energy_delivery_low',
|
|
|
|
|
'has_entity_name': False,
|
|
|
|
|
'hidden_by': None,
|
|
|
|
|
'icon': None,
|
|
|
|
|
'id': <ANY>,
|
|
|
|
|
'labels': set({
|
|
|
|
|
}),
|
|
|
|
|
'name': None,
|
|
|
|
|
'options': dict({
|
|
|
|
|
}),
|
|
|
|
|
'original_device_class': <SensorDeviceClass.ENERGY: 'energy'>,
|
|
|
|
|
'original_icon': None,
|
|
|
|
|
'original_name': 'Energy delivery low',
|
|
|
|
|
'platform': 'youless',
|
|
|
|
|
'previous_unique_id': None,
|
|
|
|
|
'supported_features': 0,
|
|
|
|
|
'translation_key': None,
|
|
|
|
|
'unique_id': 'youless_localhost_delivery_low',
|
|
|
|
|
'unit_of_measurement': <UnitOfEnergy.KILO_WATT_HOUR: 'kWh'>,
|
|
|
|
|
})
|
|
|
|
|
# ---
|
|
|
|
|
# name: test_sensors[sensor.energy_delivery_low-state]
|
|
|
|
|
StateSnapshot({
|
|
|
|
|
'attributes': ReadOnlyDict({
|
|
|
|
|
'device_class': 'energy',
|
|
|
|
|
'friendly_name': 'Energy delivery low',
|
|
|
|
|
'state_class': <SensorStateClass.TOTAL_INCREASING: 'total_increasing'>,
|
|
|
|
|
'unit_of_measurement': <UnitOfEnergy.KILO_WATT_HOUR: 'kWh'>,
|
|
|
|
|
}),
|
|
|
|
|
'context': <ANY>,
|
|
|
|
|
'entity_id': 'sensor.energy_delivery_low',
|
|
|
|
|
'last_changed': <ANY>,
|
|
|
|
|
'last_reported': <ANY>,
|
|
|
|
|
'last_updated': <ANY>,
|
|
|
|
|
'state': 'unavailable',
|
|
|
|
|
})
|
|
|
|
|
# ---
|
|
|
|
|
# name: test_sensors[sensor.energy_high-entry]
|
|
|
|
|
EntityRegistryEntrySnapshot({
|
|
|
|
|
'aliases': set({
|
|
|
|
|
}),
|
|
|
|
|
'area_id': None,
|
|
|
|
|
'capabilities': dict({
|
|
|
|
|
'state_class': <SensorStateClass.TOTAL_INCREASING: 'total_increasing'>,
|
|
|
|
|
}),
|
|
|
|
|
'config_entry_id': <ANY>,
|
|
|
|
|
'device_class': None,
|
|
|
|
|
'device_id': <ANY>,
|
|
|
|
|
'disabled_by': None,
|
|
|
|
|
'domain': 'sensor',
|
|
|
|
|
'entity_category': None,
|
|
|
|
|
'entity_id': 'sensor.energy_high',
|
|
|
|
|
'has_entity_name': False,
|
|
|
|
|
'hidden_by': None,
|
|
|
|
|
'icon': None,
|
|
|
|
|
'id': <ANY>,
|
|
|
|
|
'labels': set({
|
|
|
|
|
}),
|
|
|
|
|
'name': None,
|
|
|
|
|
'options': dict({
|
|
|
|
|
}),
|
|
|
|
|
'original_device_class': <SensorDeviceClass.ENERGY: 'energy'>,
|
|
|
|
|
'original_icon': None,
|
|
|
|
|
'original_name': 'Energy high',
|
|
|
|
|
'platform': 'youless',
|
|
|
|
|
'previous_unique_id': None,
|
|
|
|
|
'supported_features': 0,
|
|
|
|
|
'translation_key': None,
|
|
|
|
|
'unique_id': 'youless_localhost_power_high',
|
|
|
|
|
'unit_of_measurement': <UnitOfEnergy.KILO_WATT_HOUR: 'kWh'>,
|
|
|
|
|
})
|
|
|
|
|
# ---
|
|
|
|
|
# name: test_sensors[sensor.energy_high-state]
|
|
|
|
|
StateSnapshot({
|
|
|
|
|
'attributes': ReadOnlyDict({
|
|
|
|
|
'device_class': 'energy',
|
|
|
|
|
'friendly_name': 'Energy high',
|
|
|
|
|
'state_class': <SensorStateClass.TOTAL_INCREASING: 'total_increasing'>,
|
|
|
|
|
'unit_of_measurement': <UnitOfEnergy.KILO_WATT_HOUR: 'kWh'>,
|
|
|
|
|
}),
|
|
|
|
|
'context': <ANY>,
|
|
|
|
|
'entity_id': 'sensor.energy_high',
|
|
|
|
|
'last_changed': <ANY>,
|
|
|
|
|
'last_reported': <ANY>,
|
|
|
|
|
'last_updated': <ANY>,
|
|
|
|
|
'state': '4490.631',
|
|
|
|
|
})
|
|
|
|
|
# ---
|
|
|
|
|
# name: test_sensors[sensor.energy_low-entry]
|
|
|
|
|
EntityRegistryEntrySnapshot({
|
|
|
|
|
'aliases': set({
|
|
|
|
|
}),
|
|
|
|
|
'area_id': None,
|
|
|
|
|
'capabilities': dict({
|
|
|
|
|
'state_class': <SensorStateClass.TOTAL_INCREASING: 'total_increasing'>,
|
|
|
|
|
}),
|
|
|
|
|
'config_entry_id': <ANY>,
|
|
|
|
|
'device_class': None,
|
|
|
|
|
'device_id': <ANY>,
|
|
|
|
|
'disabled_by': None,
|
|
|
|
|
'domain': 'sensor',
|
|
|
|
|
'entity_category': None,
|
|
|
|
|
'entity_id': 'sensor.energy_low',
|
|
|
|
|
'has_entity_name': False,
|
|
|
|
|
'hidden_by': None,
|
|
|
|
|
'icon': None,
|
|
|
|
|
'id': <ANY>,
|
|
|
|
|
'labels': set({
|
|
|
|
|
}),
|
|
|
|
|
'name': None,
|
|
|
|
|
'options': dict({
|
|
|
|
|
}),
|
|
|
|
|
'original_device_class': <SensorDeviceClass.ENERGY: 'energy'>,
|
|
|
|
|
'original_icon': None,
|
|
|
|
|
'original_name': 'Energy low',
|
|
|
|
|
'platform': 'youless',
|
|
|
|
|
'previous_unique_id': None,
|
|
|
|
|
'supported_features': 0,
|
|
|
|
|
'translation_key': None,
|
|
|
|
|
'unique_id': 'youless_localhost_power_low',
|
|
|
|
|
'unit_of_measurement': <UnitOfEnergy.KILO_WATT_HOUR: 'kWh'>,
|
|
|
|
|
})
|
|
|
|
|
# ---
|
|
|
|
|
# name: test_sensors[sensor.energy_low-state]
|
|
|
|
|
StateSnapshot({
|
|
|
|
|
'attributes': ReadOnlyDict({
|
|
|
|
|
'device_class': 'energy',
|
|
|
|
|
'friendly_name': 'Energy low',
|
|
|
|
|
'state_class': <SensorStateClass.TOTAL_INCREASING: 'total_increasing'>,
|
|
|
|
|
'unit_of_measurement': <UnitOfEnergy.KILO_WATT_HOUR: 'kWh'>,
|
|
|
|
|
}),
|
|
|
|
|
'context': <ANY>,
|
|
|
|
|
'entity_id': 'sensor.energy_low',
|
|
|
|
|
'last_changed': <ANY>,
|
|
|
|
|
'last_reported': <ANY>,
|
|
|
|
|
'last_updated': <ANY>,
|
|
|
|
|
'state': '4703.562',
|
|
|
|
|
})
|
|
|
|
|
# ---
|
|
|
|
|
# name: test_sensors[sensor.energy_total-entry]
|
|
|
|
|
EntityRegistryEntrySnapshot({
|
|
|
|
|
'aliases': set({
|
|
|
|
|
}),
|
|
|
|
|
'area_id': None,
|
|
|
|
|
'capabilities': dict({
|
|
|
|
|
'state_class': <SensorStateClass.TOTAL: 'total'>,
|
|
|
|
|
}),
|
|
|
|
|
'config_entry_id': <ANY>,
|
|
|
|
|
'device_class': None,
|
|
|
|
|
'device_id': <ANY>,
|
|
|
|
|
'disabled_by': None,
|
|
|
|
|
'domain': 'sensor',
|
|
|
|
|
'entity_category': None,
|
|
|
|
|
'entity_id': 'sensor.energy_total',
|
|
|
|
|
'has_entity_name': False,
|
|
|
|
|
'hidden_by': None,
|
|
|
|
|
'icon': None,
|
|
|
|
|
'id': <ANY>,
|
|
|
|
|
'labels': set({
|
|
|
|
|
}),
|
|
|
|
|
'name': None,
|
|
|
|
|
'options': dict({
|
|
|
|
|
}),
|
|
|
|
|
'original_device_class': <SensorDeviceClass.ENERGY: 'energy'>,
|
|
|
|
|
'original_icon': None,
|
|
|
|
|
'original_name': 'Energy total',
|
|
|
|
|
'platform': 'youless',
|
|
|
|
|
'previous_unique_id': None,
|
|
|
|
|
'supported_features': 0,
|
|
|
|
|
'translation_key': None,
|
|
|
|
|
'unique_id': 'youless_localhost_power_total',
|
|
|
|
|
'unit_of_measurement': <UnitOfEnergy.KILO_WATT_HOUR: 'kWh'>,
|
|
|
|
|
})
|
|
|
|
|
# ---
|
|
|
|
|
# name: test_sensors[sensor.energy_total-state]
|
|
|
|
|
StateSnapshot({
|
|
|
|
|
'attributes': ReadOnlyDict({
|
|
|
|
|
'device_class': 'energy',
|
|
|
|
|
'friendly_name': 'Energy total',
|
|
|
|
|
'state_class': <SensorStateClass.TOTAL: 'total'>,
|
|
|
|
|
'unit_of_measurement': <UnitOfEnergy.KILO_WATT_HOUR: 'kWh'>,
|
|
|
|
|
}),
|
|
|
|
|
'context': <ANY>,
|
|
|
|
|
'entity_id': 'sensor.energy_total',
|
|
|
|
|
'last_changed': <ANY>,
|
|
|
|
|
'last_reported': <ANY>,
|
|
|
|
|
'last_updated': <ANY>,
|
|
|
|
|
'state': '9194.164',
|
|
|
|
|
})
|
|
|
|
|
# ---
|
|
|
|
|
# name: test_sensors[sensor.extra_total-entry]
|
|
|
|
|
EntityRegistryEntrySnapshot({
|
|
|
|
|
'aliases': set({
|
|
|
|
|
}),
|
|
|
|
|
'area_id': None,
|
|
|
|
|
'capabilities': dict({
|
|
|
|
|
'state_class': <SensorStateClass.TOTAL_INCREASING: 'total_increasing'>,
|
|
|
|
|
}),
|
|
|
|
|
'config_entry_id': <ANY>,
|
|
|
|
|
'device_class': None,
|
|
|
|
|
'device_id': <ANY>,
|
|
|
|
|
'disabled_by': None,
|
|
|
|
|
'domain': 'sensor',
|
|
|
|
|
'entity_category': None,
|
|
|
|
|
'entity_id': 'sensor.extra_total',
|
|
|
|
|
'has_entity_name': False,
|
|
|
|
|
'hidden_by': None,
|
|
|
|
|
'icon': None,
|
|
|
|
|
'id': <ANY>,
|
|
|
|
|
'labels': set({
|
|
|
|
|
}),
|
|
|
|
|
'name': None,
|
|
|
|
|
'options': dict({
|
|
|
|
|
}),
|
|
|
|
|
'original_device_class': <SensorDeviceClass.ENERGY: 'energy'>,
|
|
|
|
|
'original_icon': None,
|
|
|
|
|
'original_name': 'Extra total',
|
|
|
|
|
'platform': 'youless',
|
|
|
|
|
'previous_unique_id': None,
|
|
|
|
|
'supported_features': 0,
|
|
|
|
|
'translation_key': None,
|
|
|
|
|
'unique_id': 'youless_localhost_extra_total',
|
|
|
|
|
'unit_of_measurement': <UnitOfEnergy.KILO_WATT_HOUR: 'kWh'>,
|
|
|
|
|
})
|
|
|
|
|
# ---
|
|
|
|
|
# name: test_sensors[sensor.extra_total-state]
|
|
|
|
|
StateSnapshot({
|
|
|
|
|
'attributes': ReadOnlyDict({
|
|
|
|
|
'device_class': 'energy',
|
|
|
|
|
'friendly_name': 'Extra total',
|
|
|
|
|
'state_class': <SensorStateClass.TOTAL_INCREASING: 'total_increasing'>,
|
|
|
|
|
'unit_of_measurement': <UnitOfEnergy.KILO_WATT_HOUR: 'kWh'>,
|
|
|
|
|
}),
|
|
|
|
|
'context': <ANY>,
|
|
|
|
|
'entity_id': 'sensor.extra_total',
|
|
|
|
|
'last_changed': <ANY>,
|
|
|
|
|
'last_reported': <ANY>,
|
|
|
|
|
'last_updated': <ANY>,
|
|
|
|
|
'state': '0.0',
|
|
|
|
|
})
|
|
|
|
|
# ---
|
|
|
|
|
# name: test_sensors[sensor.extra_usage-entry]
|
|
|
|
|
EntityRegistryEntrySnapshot({
|
|
|
|
|
'aliases': set({
|
|
|
|
|
}),
|
|
|
|
|
'area_id': None,
|
|
|
|
|
'capabilities': dict({
|
|
|
|
|
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
|
|
|
|
|
}),
|
|
|
|
|
'config_entry_id': <ANY>,
|
|
|
|
|
'device_class': None,
|
|
|
|
|
'device_id': <ANY>,
|
|
|
|
|
'disabled_by': None,
|
|
|
|
|
'domain': 'sensor',
|
|
|
|
|
'entity_category': None,
|
|
|
|
|
'entity_id': 'sensor.extra_usage',
|
|
|
|
|
'has_entity_name': False,
|
|
|
|
|
'hidden_by': None,
|
|
|
|
|
'icon': None,
|
|
|
|
|
'id': <ANY>,
|
|
|
|
|
'labels': set({
|
|
|
|
|
}),
|
|
|
|
|
'name': None,
|
|
|
|
|
'options': dict({
|
|
|
|
|
}),
|
|
|
|
|
'original_device_class': <SensorDeviceClass.POWER: 'power'>,
|
|
|
|
|
'original_icon': None,
|
|
|
|
|
'original_name': 'Extra usage',
|
|
|
|
|
'platform': 'youless',
|
|
|
|
|
'previous_unique_id': None,
|
|
|
|
|
'supported_features': 0,
|
|
|
|
|
'translation_key': None,
|
|
|
|
|
'unique_id': 'youless_localhost_extra_usage',
|
|
|
|
|
'unit_of_measurement': <UnitOfPower.WATT: 'W'>,
|
|
|
|
|
})
|
|
|
|
|
# ---
|
|
|
|
|
# name: test_sensors[sensor.extra_usage-state]
|
|
|
|
|
StateSnapshot({
|
|
|
|
|
'attributes': ReadOnlyDict({
|
|
|
|
|
'device_class': 'power',
|
|
|
|
|
'friendly_name': 'Extra usage',
|
|
|
|
|
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
|
|
|
|
|
'unit_of_measurement': <UnitOfPower.WATT: 'W'>,
|
|
|
|
|
}),
|
|
|
|
|
'context': <ANY>,
|
|
|
|
|
'entity_id': 'sensor.extra_usage',
|
|
|
|
|
'last_changed': <ANY>,
|
|
|
|
|
'last_reported': <ANY>,
|
|
|
|
|
'last_updated': <ANY>,
|
|
|
|
|
'state': '0',
|
|
|
|
|
})
|
|
|
|
|
# ---
|
|
|
|
|
# name: test_sensors[sensor.gas_usage-entry]
|
|
|
|
|
EntityRegistryEntrySnapshot({
|
|
|
|
|
'aliases': set({
|
|
|
|
|
}),
|
|
|
|
|
'area_id': None,
|
|
|
|
|
'capabilities': dict({
|
|
|
|
|
'state_class': <SensorStateClass.TOTAL_INCREASING: 'total_increasing'>,
|
|
|
|
|
}),
|
|
|
|
|
'config_entry_id': <ANY>,
|
|
|
|
|
'device_class': None,
|
|
|
|
|
'device_id': <ANY>,
|
|
|
|
|
'disabled_by': None,
|
|
|
|
|
'domain': 'sensor',
|
|
|
|
|
'entity_category': None,
|
|
|
|
|
'entity_id': 'sensor.gas_usage',
|
|
|
|
|
'has_entity_name': False,
|
|
|
|
|
'hidden_by': None,
|
|
|
|
|
'icon': None,
|
|
|
|
|
'id': <ANY>,
|
|
|
|
|
'labels': set({
|
|
|
|
|
}),
|
|
|
|
|
'name': None,
|
|
|
|
|
'options': dict({
|
|
|
|
|
}),
|
|
|
|
|
'original_device_class': <SensorDeviceClass.GAS: 'gas'>,
|
|
|
|
|
'original_icon': 'mdi:fire',
|
|
|
|
|
'original_name': 'Gas usage',
|
|
|
|
|
'platform': 'youless',
|
|
|
|
|
'previous_unique_id': None,
|
|
|
|
|
'supported_features': 0,
|
|
|
|
|
'translation_key': None,
|
|
|
|
|
'unique_id': 'youless_localhost_gas',
|
|
|
|
|
'unit_of_measurement': <UnitOfVolume.CUBIC_METERS: 'm³'>,
|
|
|
|
|
})
|
|
|
|
|
# ---
|
|
|
|
|
# name: test_sensors[sensor.gas_usage-state]
|
|
|
|
|
StateSnapshot({
|
|
|
|
|
'attributes': ReadOnlyDict({
|
|
|
|
|
'device_class': 'gas',
|
|
|
|
|
'friendly_name': 'Gas usage',
|
|
|
|
|
'icon': 'mdi:fire',
|
|
|
|
|
'state_class': <SensorStateClass.TOTAL_INCREASING: 'total_increasing'>,
|
|
|
|
|
'unit_of_measurement': <UnitOfVolume.CUBIC_METERS: 'm³'>,
|
|
|
|
|
}),
|
|
|
|
|
'context': <ANY>,
|
|
|
|
|
'entity_id': 'sensor.gas_usage',
|
|
|
|
|
'last_changed': <ANY>,
|
|
|
|
|
'last_reported': <ANY>,
|
|
|
|
|
'last_updated': <ANY>,
|
|
|
|
|
'state': '1234.564',
|
|
|
|
|
})
|
|
|
|
|
# ---
|
|
|
|
|
# name: test_sensors[sensor.phase_1_current-entry]
|
|
|
|
|
EntityRegistryEntrySnapshot({
|
|
|
|
|
'aliases': set({
|
|
|
|
|
}),
|
|
|
|
|
'area_id': None,
|
|
|
|
|
'capabilities': dict({
|
|
|
|
|
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
|
|
|
|
|
}),
|
|
|
|
|
'config_entry_id': <ANY>,
|
|
|
|
|
'device_class': None,
|
|
|
|
|
'device_id': <ANY>,
|
|
|
|
|
'disabled_by': None,
|
|
|
|
|
'domain': 'sensor',
|
|
|
|
|
'entity_category': None,
|
|
|
|
|
'entity_id': 'sensor.phase_1_current',
|
|
|
|
|
'has_entity_name': False,
|
|
|
|
|
'hidden_by': None,
|
|
|
|
|
'icon': None,
|
|
|
|
|
'id': <ANY>,
|
|
|
|
|
'labels': set({
|
|
|
|
|
}),
|
|
|
|
|
'name': None,
|
|
|
|
|
'options': dict({
|
|
|
|
|
}),
|
|
|
|
|
'original_device_class': <SensorDeviceClass.CURRENT: 'current'>,
|
|
|
|
|
'original_icon': None,
|
|
|
|
|
'original_name': 'Phase 1 current',
|
|
|
|
|
'platform': 'youless',
|
|
|
|
|
'previous_unique_id': None,
|
|
|
|
|
'supported_features': 0,
|
|
|
|
|
'translation_key': None,
|
|
|
|
|
'unique_id': 'youless_localhost_phase_1_current',
|
|
|
|
|
'unit_of_measurement': <UnitOfElectricCurrent.AMPERE: 'A'>,
|
|
|
|
|
})
|
|
|
|
|
# ---
|
|
|
|
|
# name: test_sensors[sensor.phase_1_current-state]
|
|
|
|
|
StateSnapshot({
|
|
|
|
|
'attributes': ReadOnlyDict({
|
|
|
|
|
'device_class': 'current',
|
|
|
|
|
'friendly_name': 'Phase 1 current',
|
|
|
|
|
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
|
|
|
|
|
'unit_of_measurement': <UnitOfElectricCurrent.AMPERE: 'A'>,
|
|
|
|
|
}),
|
|
|
|
|
'context': <ANY>,
|
|
|
|
|
'entity_id': 'sensor.phase_1_current',
|
|
|
|
|
'last_changed': <ANY>,
|
|
|
|
|
'last_reported': <ANY>,
|
|
|
|
|
'last_updated': <ANY>,
|
|
|
|
|
'state': 'unavailable',
|
|
|
|
|
})
|
|
|
|
|
# ---
|
|
|
|
|
# name: test_sensors[sensor.phase_1_power-entry]
|
|
|
|
|
EntityRegistryEntrySnapshot({
|
|
|
|
|
'aliases': set({
|
|
|
|
|
}),
|
|
|
|
|
'area_id': None,
|
|
|
|
|
'capabilities': dict({
|
|
|
|
|
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
|
|
|
|
|
}),
|
|
|
|
|
'config_entry_id': <ANY>,
|
|
|
|
|
'device_class': None,
|
|
|
|
|
'device_id': <ANY>,
|
|
|
|
|
'disabled_by': None,
|
|
|
|
|
'domain': 'sensor',
|
|
|
|
|
'entity_category': None,
|
|
|
|
|
'entity_id': 'sensor.phase_1_power',
|
|
|
|
|
'has_entity_name': False,
|
|
|
|
|
'hidden_by': None,
|
|
|
|
|
'icon': None,
|
|
|
|
|
'id': <ANY>,
|
|
|
|
|
'labels': set({
|
|
|
|
|
}),
|
|
|
|
|
'name': None,
|
|
|
|
|
'options': dict({
|
|
|
|
|
}),
|
|
|
|
|
'original_device_class': <SensorDeviceClass.POWER: 'power'>,
|
|
|
|
|
'original_icon': None,
|
|
|
|
|
'original_name': 'Phase 1 power',
|
|
|
|
|
'platform': 'youless',
|
|
|
|
|
'previous_unique_id': None,
|
|
|
|
|
'supported_features': 0,
|
|
|
|
|
'translation_key': None,
|
|
|
|
|
'unique_id': 'youless_localhost_phase_1_power',
|
|
|
|
|
'unit_of_measurement': <UnitOfPower.WATT: 'W'>,
|
|
|
|
|
})
|
|
|
|
|
# ---
|
|
|
|
|
# name: test_sensors[sensor.phase_1_power-state]
|
|
|
|
|
StateSnapshot({
|
|
|
|
|
'attributes': ReadOnlyDict({
|
|
|
|
|
'device_class': 'power',
|
|
|
|
|
'friendly_name': 'Phase 1 power',
|
|
|
|
|
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
|
|
|
|
|
'unit_of_measurement': <UnitOfPower.WATT: 'W'>,
|
|
|
|
|
}),
|
|
|
|
|
'context': <ANY>,
|
|
|
|
|
'entity_id': 'sensor.phase_1_power',
|
|
|
|
|
'last_changed': <ANY>,
|
|
|
|
|
'last_reported': <ANY>,
|
|
|
|
|
'last_updated': <ANY>,
|
|
|
|
|
'state': 'unavailable',
|
|
|
|
|
})
|
|
|
|
|
# ---
|
|
|
|
|
# name: test_sensors[sensor.phase_1_voltage-entry]
|
|
|
|
|
EntityRegistryEntrySnapshot({
|
|
|
|
|
'aliases': set({
|
|
|
|
|
}),
|
|
|
|
|
'area_id': None,
|
|
|
|
|
'capabilities': dict({
|
|
|
|
|
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
|
|
|
|
|
}),
|
|
|
|
|
'config_entry_id': <ANY>,
|
|
|
|
|
'device_class': None,
|
|
|
|
|
'device_id': <ANY>,
|
|
|
|
|
'disabled_by': None,
|
|
|
|
|
'domain': 'sensor',
|
|
|
|
|
'entity_category': None,
|
|
|
|
|
'entity_id': 'sensor.phase_1_voltage',
|
|
|
|
|
'has_entity_name': False,
|
|
|
|
|
'hidden_by': None,
|
|
|
|
|
'icon': None,
|
|
|
|
|
'id': <ANY>,
|
|
|
|
|
'labels': set({
|
|
|
|
|
}),
|
|
|
|
|
'name': None,
|
|
|
|
|
'options': dict({
|
|
|
|
|
}),
|
|
|
|
|
'original_device_class': <SensorDeviceClass.VOLTAGE: 'voltage'>,
|
|
|
|
|
'original_icon': None,
|
|
|
|
|
'original_name': 'Phase 1 voltage',
|
|
|
|
|
'platform': 'youless',
|
|
|
|
|
'previous_unique_id': None,
|
|
|
|
|
'supported_features': 0,
|
|
|
|
|
'translation_key': None,
|
|
|
|
|
'unique_id': 'youless_localhost_phase_1_voltage',
|
|
|
|
|
'unit_of_measurement': <UnitOfElectricPotential.VOLT: 'V'>,
|
|
|
|
|
})
|
|
|
|
|
# ---
|
|
|
|
|
# name: test_sensors[sensor.phase_1_voltage-state]
|
|
|
|
|
StateSnapshot({
|
|
|
|
|
'attributes': ReadOnlyDict({
|
|
|
|
|
'device_class': 'voltage',
|
|
|
|
|
'friendly_name': 'Phase 1 voltage',
|
|
|
|
|
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
|
|
|
|
|
'unit_of_measurement': <UnitOfElectricPotential.VOLT: 'V'>,
|
|
|
|
|
}),
|
|
|
|
|
'context': <ANY>,
|
|
|
|
|
'entity_id': 'sensor.phase_1_voltage',
|
|
|
|
|
'last_changed': <ANY>,
|
|
|
|
|
'last_reported': <ANY>,
|
|
|
|
|
'last_updated': <ANY>,
|
|
|
|
|
'state': 'unavailable',
|
|
|
|
|
})
|
|
|
|
|
# ---
|
|
|
|
|
# name: test_sensors[sensor.phase_2_current-entry]
|
|
|
|
|
EntityRegistryEntrySnapshot({
|
|
|
|
|
'aliases': set({
|
|
|
|
|
}),
|
|
|
|
|
'area_id': None,
|
|
|
|
|
'capabilities': dict({
|
|
|
|
|
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
|
|
|
|
|
}),
|
|
|
|
|
'config_entry_id': <ANY>,
|
|
|
|
|
'device_class': None,
|
|
|
|
|
'device_id': <ANY>,
|
|
|
|
|
'disabled_by': None,
|
|
|
|
|
'domain': 'sensor',
|
|
|
|
|
'entity_category': None,
|
|
|
|
|
'entity_id': 'sensor.phase_2_current',
|
|
|
|
|
'has_entity_name': False,
|
|
|
|
|
'hidden_by': None,
|
|
|
|
|
'icon': None,
|
|
|
|
|
'id': <ANY>,
|
|
|
|
|
'labels': set({
|
|
|
|
|
}),
|
|
|
|
|
'name': None,
|
|
|
|
|
'options': dict({
|
|
|
|
|
}),
|
|
|
|
|
'original_device_class': <SensorDeviceClass.CURRENT: 'current'>,
|
|
|
|
|
'original_icon': None,
|
|
|
|
|
'original_name': 'Phase 2 current',
|
|
|
|
|
'platform': 'youless',
|
|
|
|
|
'previous_unique_id': None,
|
|
|
|
|
'supported_features': 0,
|
|
|
|
|
'translation_key': None,
|
|
|
|
|
'unique_id': 'youless_localhost_phase_2_current',
|
|
|
|
|
'unit_of_measurement': <UnitOfElectricCurrent.AMPERE: 'A'>,
|
|
|
|
|
})
|
|
|
|
|
# ---
|
|
|
|
|
# name: test_sensors[sensor.phase_2_current-state]
|
|
|
|
|
StateSnapshot({
|
|
|
|
|
'attributes': ReadOnlyDict({
|
|
|
|
|
'device_class': 'current',
|
|
|
|
|
'friendly_name': 'Phase 2 current',
|
|
|
|
|
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
|
|
|
|
|
'unit_of_measurement': <UnitOfElectricCurrent.AMPERE: 'A'>,
|
|
|
|
|
}),
|
|
|
|
|
'context': <ANY>,
|
|
|
|
|
'entity_id': 'sensor.phase_2_current',
|
|
|
|
|
'last_changed': <ANY>,
|
|
|
|
|
'last_reported': <ANY>,
|
|
|
|
|
'last_updated': <ANY>,
|
|
|
|
|
'state': 'unavailable',
|
|
|
|
|
})
|
|
|
|
|
# ---
|
|
|
|
|
# name: test_sensors[sensor.phase_2_power-entry]
|
|
|
|
|
EntityRegistryEntrySnapshot({
|
|
|
|
|
'aliases': set({
|
|
|
|
|
}),
|
|
|
|
|
'area_id': None,
|
|
|
|
|
'capabilities': dict({
|
|
|
|
|
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
|
|
|
|
|
}),
|
|
|
|
|
'config_entry_id': <ANY>,
|
|
|
|
|
'device_class': None,
|
|
|
|
|
'device_id': <ANY>,
|
|
|
|
|
'disabled_by': None,
|
|
|
|
|
'domain': 'sensor',
|
|
|
|
|
'entity_category': None,
|
|
|
|
|
'entity_id': 'sensor.phase_2_power',
|
|
|
|
|
'has_entity_name': False,
|
|
|
|
|
'hidden_by': None,
|
|
|
|
|
'icon': None,
|
|
|
|
|
'id': <ANY>,
|
|
|
|
|
'labels': set({
|
|
|
|
|
}),
|
|
|
|
|
'name': None,
|
|
|
|
|
'options': dict({
|
|
|
|
|
}),
|
|
|
|
|
'original_device_class': <SensorDeviceClass.POWER: 'power'>,
|
|
|
|
|
'original_icon': None,
|
|
|
|
|
'original_name': 'Phase 2 power',
|
|
|
|
|
'platform': 'youless',
|
|
|
|
|
'previous_unique_id': None,
|
|
|
|
|
'supported_features': 0,
|
|
|
|
|
'translation_key': None,
|
|
|
|
|
'unique_id': 'youless_localhost_phase_2_power',
|
|
|
|
|
'unit_of_measurement': <UnitOfPower.WATT: 'W'>,
|
|
|
|
|
})
|
|
|
|
|
# ---
|
|
|
|
|
# name: test_sensors[sensor.phase_2_power-state]
|
|
|
|
|
StateSnapshot({
|
|
|
|
|
'attributes': ReadOnlyDict({
|
|
|
|
|
'device_class': 'power',
|
|
|
|
|
'friendly_name': 'Phase 2 power',
|
|
|
|
|
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
|
|
|
|
|
'unit_of_measurement': <UnitOfPower.WATT: 'W'>,
|
|
|
|
|
}),
|
|
|
|
|
'context': <ANY>,
|
|
|
|
|
'entity_id': 'sensor.phase_2_power',
|
|
|
|
|
'last_changed': <ANY>,
|
|
|
|
|
'last_reported': <ANY>,
|
|
|
|
|
'last_updated': <ANY>,
|
|
|
|
|
'state': 'unavailable',
|
|
|
|
|
})
|
|
|
|
|
# ---
|
|
|
|
|
# name: test_sensors[sensor.phase_2_voltage-entry]
|
|
|
|
|
EntityRegistryEntrySnapshot({
|
|
|
|
|
'aliases': set({
|
|
|
|
|
}),
|
|
|
|
|
'area_id': None,
|
|
|
|
|
'capabilities': dict({
|
|
|
|
|
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
|
|
|
|
|
}),
|
|
|
|
|
'config_entry_id': <ANY>,
|
|
|
|
|
'device_class': None,
|
|
|
|
|
'device_id': <ANY>,
|
|
|
|
|
'disabled_by': None,
|
|
|
|
|
'domain': 'sensor',
|
|
|
|
|
'entity_category': None,
|
|
|
|
|
'entity_id': 'sensor.phase_2_voltage',
|
|
|
|
|
'has_entity_name': False,
|
|
|
|
|
'hidden_by': None,
|
|
|
|
|
'icon': None,
|
|
|
|
|
'id': <ANY>,
|
|
|
|
|
'labels': set({
|
|
|
|
|
}),
|
|
|
|
|
'name': None,
|
|
|
|
|
'options': dict({
|
|
|
|
|
}),
|
|
|
|
|
'original_device_class': <SensorDeviceClass.VOLTAGE: 'voltage'>,
|
|
|
|
|
'original_icon': None,
|
|
|
|
|
'original_name': 'Phase 2 voltage',
|
|
|
|
|
'platform': 'youless',
|
|
|
|
|
'previous_unique_id': None,
|
|
|
|
|
'supported_features': 0,
|
|
|
|
|
'translation_key': None,
|
|
|
|
|
'unique_id': 'youless_localhost_phase_2_voltage',
|
|
|
|
|
'unit_of_measurement': <UnitOfElectricPotential.VOLT: 'V'>,
|
|
|
|
|
})
|
|
|
|
|
# ---
|
|
|
|
|
# name: test_sensors[sensor.phase_2_voltage-state]
|
|
|
|
|
StateSnapshot({
|
|
|
|
|
'attributes': ReadOnlyDict({
|
|
|
|
|
'device_class': 'voltage',
|
|
|
|
|
'friendly_name': 'Phase 2 voltage',
|
|
|
|
|
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
|
|
|
|
|
'unit_of_measurement': <UnitOfElectricPotential.VOLT: 'V'>,
|
|
|
|
|
}),
|
|
|
|
|
'context': <ANY>,
|
|
|
|
|
'entity_id': 'sensor.phase_2_voltage',
|
|
|
|
|
'last_changed': <ANY>,
|
|
|
|
|
'last_reported': <ANY>,
|
|
|
|
|
'last_updated': <ANY>,
|
|
|
|
|
'state': 'unavailable',
|
|
|
|
|
})
|
|
|
|
|
# ---
|
|
|
|
|
# name: test_sensors[sensor.phase_3_current-entry]
|
|
|
|
|
EntityRegistryEntrySnapshot({
|
|
|
|
|
'aliases': set({
|
|
|
|
|
}),
|
|
|
|
|
'area_id': None,
|
|
|
|
|
'capabilities': dict({
|
|
|
|
|
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
|
|
|
|
|
}),
|
|
|
|
|
'config_entry_id': <ANY>,
|
|
|
|
|
'device_class': None,
|
|
|
|
|
'device_id': <ANY>,
|
|
|
|
|
'disabled_by': None,
|
|
|
|
|
'domain': 'sensor',
|
|
|
|
|
'entity_category': None,
|
|
|
|
|
'entity_id': 'sensor.phase_3_current',
|
|
|
|
|
'has_entity_name': False,
|
|
|
|
|
'hidden_by': None,
|
|
|
|
|
'icon': None,
|
|
|
|
|
'id': <ANY>,
|
|
|
|
|
'labels': set({
|
|
|
|
|
}),
|
|
|
|
|
'name': None,
|
|
|
|
|
'options': dict({
|
|
|
|
|
}),
|
|
|
|
|
'original_device_class': <SensorDeviceClass.CURRENT: 'current'>,
|
|
|
|
|
'original_icon': None,
|
|
|
|
|
'original_name': 'Phase 3 current',
|
|
|
|
|
'platform': 'youless',
|
|
|
|
|
'previous_unique_id': None,
|
|
|
|
|
'supported_features': 0,
|
|
|
|
|
'translation_key': None,
|
|
|
|
|
'unique_id': 'youless_localhost_phase_3_current',
|
|
|
|
|
'unit_of_measurement': <UnitOfElectricCurrent.AMPERE: 'A'>,
|
|
|
|
|
})
|
|
|
|
|
# ---
|
|
|
|
|
# name: test_sensors[sensor.phase_3_current-state]
|
|
|
|
|
StateSnapshot({
|
|
|
|
|
'attributes': ReadOnlyDict({
|
|
|
|
|
'device_class': 'current',
|
|
|
|
|
'friendly_name': 'Phase 3 current',
|
|
|
|
|
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
|
|
|
|
|
'unit_of_measurement': <UnitOfElectricCurrent.AMPERE: 'A'>,
|
|
|
|
|
}),
|
|
|
|
|
'context': <ANY>,
|
|
|
|
|
'entity_id': 'sensor.phase_3_current',
|
|
|
|
|
'last_changed': <ANY>,
|
|
|
|
|
'last_reported': <ANY>,
|
|
|
|
|
'last_updated': <ANY>,
|
|
|
|
|
'state': 'unavailable',
|
|
|
|
|
})
|
|
|
|
|
# ---
|
|
|
|
|
# name: test_sensors[sensor.phase_3_power-entry]
|
|
|
|
|
EntityRegistryEntrySnapshot({
|
|
|
|
|
'aliases': set({
|
|
|
|
|
}),
|
|
|
|
|
'area_id': None,
|
|
|
|
|
'capabilities': dict({
|
|
|
|
|
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
|
|
|
|
|
}),
|
|
|
|
|
'config_entry_id': <ANY>,
|
|
|
|
|
'device_class': None,
|
|
|
|
|
'device_id': <ANY>,
|
|
|
|
|
'disabled_by': None,
|
|
|
|
|
'domain': 'sensor',
|
|
|
|
|
'entity_category': None,
|
|
|
|
|
'entity_id': 'sensor.phase_3_power',
|
|
|
|
|
'has_entity_name': False,
|
|
|
|
|
'hidden_by': None,
|
|
|
|
|
'icon': None,
|
|
|
|
|
'id': <ANY>,
|
|
|
|
|
'labels': set({
|
|
|
|
|
}),
|
|
|
|
|
'name': None,
|
|
|
|
|
'options': dict({
|
|
|
|
|
}),
|
|
|
|
|
'original_device_class': <SensorDeviceClass.POWER: 'power'>,
|
|
|
|
|
'original_icon': None,
|
|
|
|
|
'original_name': 'Phase 3 power',
|
|
|
|
|
'platform': 'youless',
|
|
|
|
|
'previous_unique_id': None,
|
|
|
|
|
'supported_features': 0,
|
|
|
|
|
'translation_key': None,
|
|
|
|
|
'unique_id': 'youless_localhost_phase_3_power',
|
|
|
|
|
'unit_of_measurement': <UnitOfPower.WATT: 'W'>,
|
|
|
|
|
})
|
|
|
|
|
# ---
|
|
|
|
|
# name: test_sensors[sensor.phase_3_power-state]
|
|
|
|
|
StateSnapshot({
|
|
|
|
|
'attributes': ReadOnlyDict({
|
|
|
|
|
'device_class': 'power',
|
|
|
|
|
'friendly_name': 'Phase 3 power',
|
|
|
|
|
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
|
|
|
|
|
'unit_of_measurement': <UnitOfPower.WATT: 'W'>,
|
|
|
|
|
}),
|
|
|
|
|
'context': <ANY>,
|
|
|
|
|
'entity_id': 'sensor.phase_3_power',
|
|
|
|
|
'last_changed': <ANY>,
|
|
|
|
|
'last_reported': <ANY>,
|
|
|
|
|
'last_updated': <ANY>,
|
|
|
|
|
'state': 'unavailable',
|
|
|
|
|
})
|
|
|
|
|
# ---
|
|
|
|
|
# name: test_sensors[sensor.phase_3_voltage-entry]
|
|
|
|
|
EntityRegistryEntrySnapshot({
|
|
|
|
|
'aliases': set({
|
|
|
|
|
}),
|
|
|
|
|
'area_id': None,
|
|
|
|
|
'capabilities': dict({
|
|
|
|
|
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
|
|
|
|
|
}),
|
|
|
|
|
'config_entry_id': <ANY>,
|
|
|
|
|
'device_class': None,
|
|
|
|
|
'device_id': <ANY>,
|
|
|
|
|
'disabled_by': None,
|
|
|
|
|
'domain': 'sensor',
|
|
|
|
|
'entity_category': None,
|
|
|
|
|
'entity_id': 'sensor.phase_3_voltage',
|
|
|
|
|
'has_entity_name': False,
|
|
|
|
|
'hidden_by': None,
|
|
|
|
|
'icon': None,
|
|
|
|
|
'id': <ANY>,
|
|
|
|
|
'labels': set({
|
|
|
|
|
}),
|
|
|
|
|
'name': None,
|
|
|
|
|
'options': dict({
|
|
|
|
|
}),
|
|
|
|
|
'original_device_class': <SensorDeviceClass.VOLTAGE: 'voltage'>,
|
|
|
|
|
'original_icon': None,
|
|
|
|
|
'original_name': 'Phase 3 voltage',
|
|
|
|
|
'platform': 'youless',
|
|
|
|
|
'previous_unique_id': None,
|
|
|
|
|
'supported_features': 0,
|
|
|
|
|
'translation_key': None,
|
|
|
|
|
'unique_id': 'youless_localhost_phase_3_voltage',
|
|
|
|
|
'unit_of_measurement': <UnitOfElectricPotential.VOLT: 'V'>,
|
|
|
|
|
})
|
|
|
|
|
# ---
|
|
|
|
|
# name: test_sensors[sensor.phase_3_voltage-state]
|
|
|
|
|
StateSnapshot({
|
|
|
|
|
'attributes': ReadOnlyDict({
|
|
|
|
|
'device_class': 'voltage',
|
|
|
|
|
'friendly_name': 'Phase 3 voltage',
|
|
|
|
|
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
|
|
|
|
|
'unit_of_measurement': <UnitOfElectricPotential.VOLT: 'V'>,
|
|
|
|
|
}),
|
|
|
|
|
'context': <ANY>,
|
|
|
|
|
'entity_id': 'sensor.phase_3_voltage',
|
|
|
|
|
'last_changed': <ANY>,
|
|
|
|
|
'last_reported': <ANY>,
|
|
|
|
|
'last_updated': <ANY>,
|
|
|
|
|
'state': 'unavailable',
|
|
|
|
|
})
|
|
|
|
|
# ---
|
|
|
|
|
# name: test_sensors[sensor.power_usage-entry]
|
|
|
|
|
EntityRegistryEntrySnapshot({
|
|
|
|
|
'aliases': set({
|
|
|
|
|
}),
|
|
|
|
|
'area_id': None,
|
|
|
|
|
'capabilities': dict({
|
|
|
|
|
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
|
|
|
|
|
}),
|
|
|
|
|
'config_entry_id': <ANY>,
|
|
|
|
|
'device_class': None,
|
|
|
|
|
'device_id': <ANY>,
|
|
|
|
|
'disabled_by': None,
|
|
|
|
|
'domain': 'sensor',
|
|
|
|
|
'entity_category': None,
|
|
|
|
|
'entity_id': 'sensor.power_usage',
|
|
|
|
|
'has_entity_name': False,
|
|
|
|
|
'hidden_by': None,
|
|
|
|
|
'icon': None,
|
|
|
|
|
'id': <ANY>,
|
|
|
|
|
'labels': set({
|
|
|
|
|
}),
|
|
|
|
|
'name': None,
|
|
|
|
|
'options': dict({
|
|
|
|
|
}),
|
|
|
|
|
'original_device_class': <SensorDeviceClass.POWER: 'power'>,
|
|
|
|
|
'original_icon': None,
|
|
|
|
|
'original_name': 'Power Usage',
|
|
|
|
|
'platform': 'youless',
|
|
|
|
|
'previous_unique_id': None,
|
|
|
|
|
'supported_features': 0,
|
|
|
|
|
'translation_key': None,
|
|
|
|
|
'unique_id': 'youless_localhost_usage',
|
|
|
|
|
'unit_of_measurement': <UnitOfPower.WATT: 'W'>,
|
|
|
|
|
})
|
|
|
|
|
# ---
|
|
|
|
|
# name: test_sensors[sensor.power_usage-state]
|
|
|
|
|
StateSnapshot({
|
|
|
|
|
'attributes': ReadOnlyDict({
|
|
|
|
|
'device_class': 'power',
|
|
|
|
|
'friendly_name': 'Power Usage',
|
|
|
|
|
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
|
|
|
|
|
'unit_of_measurement': <UnitOfPower.WATT: 'W'>,
|
|
|
|
|
}),
|
|
|
|
|
'context': <ANY>,
|
|
|
|
|
'entity_id': 'sensor.power_usage',
|
|
|
|
|
'last_changed': <ANY>,
|
|
|
|
|
'last_reported': <ANY>,
|
|
|
|
|
'last_updated': <ANY>,
|
|
|
|
|
'state': '2382',
|
|
|
|
|
})
|
|
|
|
|
# ---
|
|
|
|
|
# name: test_sensors[sensor.water_usage-entry]
|
|
|
|
|
EntityRegistryEntrySnapshot({
|
|
|
|
|
'aliases': set({
|
|
|
|
|
}),
|
|
|
|
|
'area_id': None,
|
|
|
|
|
'capabilities': dict({
|
|
|
|
|
'state_class': <SensorStateClass.TOTAL_INCREASING: 'total_increasing'>,
|
|
|
|
|
}),
|
|
|
|
|
'config_entry_id': <ANY>,
|
|
|
|
|
'device_class': None,
|
|
|
|
|
'device_id': <ANY>,
|
|
|
|
|
'disabled_by': None,
|
|
|
|
|
'domain': 'sensor',
|
|
|
|
|
'entity_category': None,
|
|
|
|
|
'entity_id': 'sensor.water_usage',
|
|
|
|
|
'has_entity_name': False,
|
|
|
|
|
'hidden_by': None,
|
|
|
|
|
'icon': None,
|
|
|
|
|
'id': <ANY>,
|
|
|
|
|
'labels': set({
|
|
|
|
|
}),
|
|
|
|
|
'name': None,
|
|
|
|
|
'options': dict({
|
|
|
|
|
}),
|
|
|
|
|
'original_device_class': <SensorDeviceClass.WATER: 'water'>,
|
|
|
|
|
'original_icon': 'mdi:water',
|
|
|
|
|
'original_name': 'Water usage',
|
|
|
|
|
'platform': 'youless',
|
|
|
|
|
'previous_unique_id': None,
|
|
|
|
|
'supported_features': 0,
|
|
|
|
|
'translation_key': None,
|
|
|
|
|
'unique_id': 'youless_localhost_water',
|
|
|
|
|
'unit_of_measurement': <UnitOfVolume.CUBIC_METERS: 'm³'>,
|
|
|
|
|
})
|
|
|
|
|
# ---
|
|
|
|
|
# name: test_sensors[sensor.water_usage-state]
|
|
|
|
|
StateSnapshot({
|
|
|
|
|
'attributes': ReadOnlyDict({
|
|
|
|
|
'device_class': 'water',
|
|
|
|
|
'friendly_name': 'Water usage',
|
|
|
|
|
'icon': 'mdi:water',
|
|
|
|
|
'state_class': <SensorStateClass.TOTAL_INCREASING: 'total_increasing'>,
|
|
|
|
|
'unit_of_measurement': <UnitOfVolume.CUBIC_METERS: 'm³'>,
|
|
|
|
|
}),
|
|
|
|
|
'context': <ANY>,
|
|
|
|
|
'entity_id': 'sensor.water_usage',
|
|
|
|
|
'last_changed': <ANY>,
|
|
|
|
|
'last_reported': <ANY>,
|
|
|
|
|
'last_updated': <ANY>,
|
|
|
|
|
'state': 'unavailable',
|
|
|
|
|
})
|
|
|
|
|
# ---
|