Compare commits

...

4 Commits

Author SHA1 Message Date
Ludovic BOUÉ
6b9647e55e Update snapshots 2026-02-02 17:39:46 +00:00
Ludovic BOUÉ
1146899115 Merge branch 'dev' into dev 2026-02-02 13:22:11 +01:00
kshypachov
eb4577ef33 Fix formatting of allow_none_value in sensor.py 2026-02-01 23:42:37 +02:00
kshypachov
cd2c946107 Added the parameter
allow_none_value = True

since in Matter, null is a valid value for the imported energy structure.
2026-02-01 21:52:38 +02:00
2 changed files with 121 additions and 0 deletions

View File

@@ -1014,6 +1014,7 @@ DISCOVERY_SCHEMAS = [
device_to_ha=lambda x: x.energy,
),
entity_class=MatterSensor,
allow_none_value=True,
required_attributes=(
clusters.ElectricalEnergyMeasurement.Attributes.CumulativeEnergyImported,
),

View File

@@ -11068,6 +11068,66 @@
'state': '32.0',
})
# ---
# name: test_sensors[silabs_evse_charging][sensor.evse_energy-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': dict({
'state_class': <SensorStateClass.TOTAL_INCREASING: 'total_increasing'>,
}),
'config_entry_id': <ANY>,
'config_subentry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'sensor',
'entity_category': <EntityCategory.DIAGNOSTIC: 'diagnostic'>,
'entity_id': 'sensor.evse_energy',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'object_id_base': 'Energy',
'options': dict({
'sensor': dict({
'suggested_display_precision': 3,
}),
'sensor.private': dict({
'suggested_unit_of_measurement': <UnitOfEnergy.KILO_WATT_HOUR: 'kWh'>,
}),
}),
'original_device_class': <SensorDeviceClass.ENERGY: 'energy'>,
'original_icon': None,
'original_name': 'Energy',
'platform': 'matter',
'previous_unique_id': None,
'suggested_object_id': None,
'supported_features': 0,
'translation_key': None,
'unique_id': '00000000000004D2-0000000000000017-MatterNodeDevice-1-ElectricalEnergyMeasurementCumulativeEnergyImported-145-1',
'unit_of_measurement': <UnitOfEnergy.KILO_WATT_HOUR: 'kWh'>,
})
# ---
# name: test_sensors[silabs_evse_charging][sensor.evse_energy-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'energy',
'friendly_name': 'evse Energy',
'state_class': <SensorStateClass.TOTAL_INCREASING: 'total_increasing'>,
'unit_of_measurement': <UnitOfEnergy.KILO_WATT_HOUR: 'kWh'>,
}),
'context': <ANY>,
'entity_id': 'sensor.evse_energy',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'unknown',
})
# ---
# name: test_sensors[silabs_evse_charging][sensor.evse_energy_optimization_opt_out-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
@@ -12056,6 +12116,66 @@
'state': 'online',
})
# ---
# name: test_sensors[silabs_water_heater][sensor.water_heater_energy-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': dict({
'state_class': <SensorStateClass.TOTAL_INCREASING: 'total_increasing'>,
}),
'config_entry_id': <ANY>,
'config_subentry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'sensor',
'entity_category': <EntityCategory.DIAGNOSTIC: 'diagnostic'>,
'entity_id': 'sensor.water_heater_energy',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'object_id_base': 'Energy',
'options': dict({
'sensor': dict({
'suggested_display_precision': 3,
}),
'sensor.private': dict({
'suggested_unit_of_measurement': <UnitOfEnergy.KILO_WATT_HOUR: 'kWh'>,
}),
}),
'original_device_class': <SensorDeviceClass.ENERGY: 'energy'>,
'original_icon': None,
'original_name': 'Energy',
'platform': 'matter',
'previous_unique_id': None,
'suggested_object_id': None,
'supported_features': 0,
'translation_key': None,
'unique_id': '00000000000004D2-0000000000000019-MatterNodeDevice-2-ElectricalEnergyMeasurementCumulativeEnergyImported-145-1',
'unit_of_measurement': <UnitOfEnergy.KILO_WATT_HOUR: 'kWh'>,
})
# ---
# name: test_sensors[silabs_water_heater][sensor.water_heater_energy-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'energy',
'friendly_name': 'Water Heater Energy',
'state_class': <SensorStateClass.TOTAL_INCREASING: 'total_increasing'>,
'unit_of_measurement': <UnitOfEnergy.KILO_WATT_HOUR: 'kWh'>,
}),
'context': <ANY>,
'entity_id': 'sensor.water_heater_energy',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'unknown',
})
# ---
# name: test_sensors[silabs_water_heater][sensor.water_heater_energy_optimization_opt_out-entry]
EntityRegistryEntrySnapshot({
'aliases': set({