Skip to content

Commit 2a969b8

Browse files
authored
Fix entity_id to follow HA conventions (#263)
Seen since HA 2026.2.0: ``` Detected that custom integration 'spothinta' sets an invalid entity ID: 'sensor.spothinta_FI_energy_min_price_tomorrow'. In most cases, entities should not set entity_id, but if they do, it should be a valid entity ID.. This will stop working in Home Assistant 2027.2.0, please create a bug report at https://github.com/slovdahl/home-assistant-spothinta/issues ```
1 parent 2cf1ad9 commit 2a969b8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

custom_components/spothinta/sensor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ def __init__(
170170
"""Initialize Spot-Hinta.fi sensor."""
171171
super().__init__(coordinator=coordinator)
172172
self.entity_description = description
173-
self.entity_id = f"{SENSOR_DOMAIN}.{DOMAIN}_{coordinator.region.name}_{description.service_type}_{description.key}"
173+
self.entity_id = f"{SENSOR_DOMAIN}.{DOMAIN}_{coordinator.region.name.lower()}_{description.service_type}_{description.key}"
174174
self._attr_unique_id = f"{coordinator.config_entry.entry_id}_{description.service_type}_{description.key}"
175175
self._attr_device_info = DeviceInfo(
176176
entry_type=DeviceEntryType.SERVICE,

0 commit comments

Comments
 (0)