mirror of
https://github.com/home-assistant/core.git
synced 2025-07-09 06:17:07 +00:00
Fix Island status in Teslemetry (#127504)
This commit is contained in:
parent
927943e07a
commit
ae6add1e77
@ -378,7 +378,17 @@ ENERGY_LIVE_DESCRIPTIONS: tuple[SensorEntityDescription, ...] = (
|
|||||||
device_class=SensorDeviceClass.POWER,
|
device_class=SensorDeviceClass.POWER,
|
||||||
entity_registry_enabled_default=False,
|
entity_registry_enabled_default=False,
|
||||||
),
|
),
|
||||||
SensorEntityDescription(key="island_status", device_class=SensorDeviceClass.ENUM),
|
SensorEntityDescription(
|
||||||
|
key="island_status",
|
||||||
|
device_class=SensorDeviceClass.ENUM,
|
||||||
|
options=[
|
||||||
|
"on_grid",
|
||||||
|
"off_grid",
|
||||||
|
"off_grid_intentional",
|
||||||
|
"off_grid_unintentional",
|
||||||
|
"island_status_unknown",
|
||||||
|
],
|
||||||
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
WALL_CONNECTOR_DESCRIPTIONS: tuple[TeslemetrySensorEntityDescription, ...] = (
|
WALL_CONNECTOR_DESCRIPTIONS: tuple[TeslemetrySensorEntityDescription, ...] = (
|
||||||
|
@ -392,6 +392,16 @@
|
|||||||
"grid_services_power": {
|
"grid_services_power": {
|
||||||
"name": "Grid services power"
|
"name": "Grid services power"
|
||||||
},
|
},
|
||||||
|
"island_status": {
|
||||||
|
"name": "Island status",
|
||||||
|
"state": {
|
||||||
|
"island_status_unknown": "Unknown",
|
||||||
|
"on_grid": "On grid",
|
||||||
|
"off_grid": "Off grid",
|
||||||
|
"off_grid_intentional": "Off grid intentional",
|
||||||
|
"off_grid_unintentional": "Off grid unintentional"
|
||||||
|
}
|
||||||
|
},
|
||||||
"load_power": {
|
"load_power": {
|
||||||
"name": "Load power"
|
"name": "Load power"
|
||||||
},
|
},
|
||||||
|
@ -1751,6 +1751,89 @@
|
|||||||
'state': '0.074',
|
'state': '0.074',
|
||||||
})
|
})
|
||||||
# ---
|
# ---
|
||||||
|
# name: test_sensors[sensor.energy_site_island_status-entry]
|
||||||
|
EntityRegistryEntrySnapshot({
|
||||||
|
'aliases': set({
|
||||||
|
}),
|
||||||
|
'area_id': None,
|
||||||
|
'capabilities': dict({
|
||||||
|
'options': list([
|
||||||
|
'on_grid',
|
||||||
|
'off_grid',
|
||||||
|
'off_grid_intentional',
|
||||||
|
'off_grid_unintentional',
|
||||||
|
'island_status_unknown',
|
||||||
|
]),
|
||||||
|
}),
|
||||||
|
'config_entry_id': <ANY>,
|
||||||
|
'device_class': None,
|
||||||
|
'device_id': <ANY>,
|
||||||
|
'disabled_by': None,
|
||||||
|
'domain': 'sensor',
|
||||||
|
'entity_category': None,
|
||||||
|
'entity_id': 'sensor.energy_site_island_status',
|
||||||
|
'has_entity_name': True,
|
||||||
|
'hidden_by': None,
|
||||||
|
'icon': None,
|
||||||
|
'id': <ANY>,
|
||||||
|
'labels': set({
|
||||||
|
}),
|
||||||
|
'name': None,
|
||||||
|
'options': dict({
|
||||||
|
}),
|
||||||
|
'original_device_class': <SensorDeviceClass.ENUM: 'enum'>,
|
||||||
|
'original_icon': None,
|
||||||
|
'original_name': 'Island status',
|
||||||
|
'platform': 'teslemetry',
|
||||||
|
'previous_unique_id': None,
|
||||||
|
'supported_features': 0,
|
||||||
|
'translation_key': 'island_status',
|
||||||
|
'unique_id': '123456-island_status',
|
||||||
|
'unit_of_measurement': None,
|
||||||
|
})
|
||||||
|
# ---
|
||||||
|
# name: test_sensors[sensor.energy_site_island_status-state]
|
||||||
|
StateSnapshot({
|
||||||
|
'attributes': ReadOnlyDict({
|
||||||
|
'device_class': 'enum',
|
||||||
|
'friendly_name': 'Energy Site Island status',
|
||||||
|
'options': list([
|
||||||
|
'on_grid',
|
||||||
|
'off_grid',
|
||||||
|
'off_grid_intentional',
|
||||||
|
'off_grid_unintentional',
|
||||||
|
'island_status_unknown',
|
||||||
|
]),
|
||||||
|
}),
|
||||||
|
'context': <ANY>,
|
||||||
|
'entity_id': 'sensor.energy_site_island_status',
|
||||||
|
'last_changed': <ANY>,
|
||||||
|
'last_reported': <ANY>,
|
||||||
|
'last_updated': <ANY>,
|
||||||
|
'state': 'on_grid',
|
||||||
|
})
|
||||||
|
# ---
|
||||||
|
# name: test_sensors[sensor.energy_site_island_status-statealt]
|
||||||
|
StateSnapshot({
|
||||||
|
'attributes': ReadOnlyDict({
|
||||||
|
'device_class': 'enum',
|
||||||
|
'friendly_name': 'Energy Site Island status',
|
||||||
|
'options': list([
|
||||||
|
'on_grid',
|
||||||
|
'off_grid',
|
||||||
|
'off_grid_intentional',
|
||||||
|
'off_grid_unintentional',
|
||||||
|
'island_status_unknown',
|
||||||
|
]),
|
||||||
|
}),
|
||||||
|
'context': <ANY>,
|
||||||
|
'entity_id': 'sensor.energy_site_island_status',
|
||||||
|
'last_changed': <ANY>,
|
||||||
|
'last_reported': <ANY>,
|
||||||
|
'last_updated': <ANY>,
|
||||||
|
'state': 'on_grid',
|
||||||
|
})
|
||||||
|
# ---
|
||||||
# name: test_sensors[sensor.energy_site_load_power-entry]
|
# name: test_sensors[sensor.energy_site_load_power-entry]
|
||||||
EntityRegistryEntrySnapshot({
|
EntityRegistryEntrySnapshot({
|
||||||
'aliases': set({
|
'aliases': set({
|
||||||
@ -1824,67 +1907,6 @@
|
|||||||
'state': '6.245',
|
'state': '6.245',
|
||||||
})
|
})
|
||||||
# ---
|
# ---
|
||||||
# name: test_sensors[sensor.energy_site_none-entry]
|
|
||||||
EntityRegistryEntrySnapshot({
|
|
||||||
'aliases': set({
|
|
||||||
}),
|
|
||||||
'area_id': None,
|
|
||||||
'capabilities': None,
|
|
||||||
'config_entry_id': <ANY>,
|
|
||||||
'device_class': None,
|
|
||||||
'device_id': <ANY>,
|
|
||||||
'disabled_by': None,
|
|
||||||
'domain': 'sensor',
|
|
||||||
'entity_category': None,
|
|
||||||
'entity_id': 'sensor.energy_site_none',
|
|
||||||
'has_entity_name': True,
|
|
||||||
'hidden_by': None,
|
|
||||||
'icon': None,
|
|
||||||
'id': <ANY>,
|
|
||||||
'labels': set({
|
|
||||||
}),
|
|
||||||
'name': None,
|
|
||||||
'options': dict({
|
|
||||||
}),
|
|
||||||
'original_device_class': <SensorDeviceClass.ENUM: 'enum'>,
|
|
||||||
'original_icon': None,
|
|
||||||
'original_name': None,
|
|
||||||
'platform': 'teslemetry',
|
|
||||||
'previous_unique_id': None,
|
|
||||||
'supported_features': 0,
|
|
||||||
'translation_key': 'island_status',
|
|
||||||
'unique_id': '123456-island_status',
|
|
||||||
'unit_of_measurement': None,
|
|
||||||
})
|
|
||||||
# ---
|
|
||||||
# name: test_sensors[sensor.energy_site_none-state]
|
|
||||||
StateSnapshot({
|
|
||||||
'attributes': ReadOnlyDict({
|
|
||||||
'device_class': 'enum',
|
|
||||||
'friendly_name': 'Energy Site None',
|
|
||||||
}),
|
|
||||||
'context': <ANY>,
|
|
||||||
'entity_id': 'sensor.energy_site_none',
|
|
||||||
'last_changed': <ANY>,
|
|
||||||
'last_reported': <ANY>,
|
|
||||||
'last_updated': <ANY>,
|
|
||||||
'state': 'on_grid',
|
|
||||||
})
|
|
||||||
# ---
|
|
||||||
# name: test_sensors[sensor.energy_site_none-statealt]
|
|
||||||
StateSnapshot({
|
|
||||||
'attributes': ReadOnlyDict({
|
|
||||||
'device_class': 'enum',
|
|
||||||
'friendly_name': 'Energy Site None',
|
|
||||||
}),
|
|
||||||
'context': <ANY>,
|
|
||||||
'entity_id': 'sensor.energy_site_none',
|
|
||||||
'last_changed': <ANY>,
|
|
||||||
'last_reported': <ANY>,
|
|
||||||
'last_updated': <ANY>,
|
|
||||||
'state': 'on_grid',
|
|
||||||
})
|
|
||||||
# ---
|
|
||||||
# name: test_sensors[sensor.energy_site_percentage_charged-entry]
|
# name: test_sensors[sensor.energy_site_percentage_charged-entry]
|
||||||
EntityRegistryEntrySnapshot({
|
EntityRegistryEntrySnapshot({
|
||||||
'aliases': set({
|
'aliases': set({
|
||||||
|
Loading…
x
Reference in New Issue
Block a user