Add Storm watch active to Tesla integrations (#126704)

pull/126729/head
Brett Adams 2024-09-25 17:05:33 +10:00 committed by GitHub
parent a5a54ab870
commit eccb7bb55f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
12 changed files with 194 additions and 0 deletions

View File

@ -165,6 +165,7 @@ VEHICLE_DESCRIPTIONS: tuple[TeslaFleetBinarySensorEntityDescription, ...] = (
ENERGY_LIVE_DESCRIPTIONS: tuple[BinarySensorEntityDescription, ...] = ( ENERGY_LIVE_DESCRIPTIONS: tuple[BinarySensorEntityDescription, ...] = (
BinarySensorEntityDescription(key="backup_capable"), BinarySensorEntityDescription(key="backup_capable"),
BinarySensorEntityDescription(key="grid_services_active"), BinarySensorEntityDescription(key="grid_services_active"),
BinarySensorEntityDescription(key="storm_mode_active"),
) )

View File

@ -7,6 +7,12 @@
"on": "mdi:hvac" "on": "mdi:hvac"
} }
}, },
"storm_mode_active": {
"default": "mdi:weather-sunny",
"state": {
"on": "mdi:weather-lightning-rainy"
}
},
"vehicle_state_is_user_present": { "vehicle_state_is_user_present": {
"state": { "state": {
"off": "mdi:account-remove-outline", "off": "mdi:account-remove-outline",

View File

@ -64,6 +64,9 @@
"state": { "state": {
"name": "Status" "name": "Status"
}, },
"storm_mode_active": {
"name": "Storm watch active"
},
"vehicle_state_dashcam_state": { "vehicle_state_dashcam_state": {
"name": "Dashcam" "name": "Dashcam"
}, },

View File

@ -165,6 +165,7 @@ VEHICLE_DESCRIPTIONS: tuple[TeslemetryBinarySensorEntityDescription, ...] = (
ENERGY_LIVE_DESCRIPTIONS: tuple[BinarySensorEntityDescription, ...] = ( ENERGY_LIVE_DESCRIPTIONS: tuple[BinarySensorEntityDescription, ...] = (
BinarySensorEntityDescription(key="backup_capable"), BinarySensorEntityDescription(key="backup_capable"),
BinarySensorEntityDescription(key="grid_services_active"), BinarySensorEntityDescription(key="grid_services_active"),
BinarySensorEntityDescription(key="storm_mode_active"),
) )

View File

@ -7,6 +7,12 @@
"on": "mdi:hvac" "on": "mdi:hvac"
} }
}, },
"storm_mode_active": {
"default": "mdi:weather-sunny",
"state": {
"on": "mdi:weather-lightning-rainy"
}
},
"vehicle_state_is_user_present": { "vehicle_state_is_user_present": {
"state": { "state": {
"off": "mdi:account-remove-outline", "off": "mdi:account-remove-outline",

View File

@ -56,6 +56,9 @@
"state": { "state": {
"name": "Status" "name": "Status"
}, },
"storm_mode_active": {
"name": "Storm watch active"
},
"vehicle_state_dashcam_state": { "vehicle_state_dashcam_state": {
"name": "Dashcam" "name": "Dashcam"
}, },

View File

@ -163,6 +163,7 @@ VEHICLE_DESCRIPTIONS: tuple[TessieBinarySensorEntityDescription, ...] = (
ENERGY_LIVE_DESCRIPTIONS: tuple[BinarySensorEntityDescription, ...] = ( ENERGY_LIVE_DESCRIPTIONS: tuple[BinarySensorEntityDescription, ...] = (
BinarySensorEntityDescription(key="backup_capable"), BinarySensorEntityDescription(key="backup_capable"),
BinarySensorEntityDescription(key="grid_services_active"), BinarySensorEntityDescription(key="grid_services_active"),
BinarySensorEntityDescription(key="storm_mode_active"),
) )

View File

@ -22,6 +22,12 @@
"climate_state_auto_steering_wheel_heat": { "climate_state_auto_steering_wheel_heat": {
"default": "mdi:steering" "default": "mdi:steering"
}, },
"storm_mode_active": {
"default": "mdi:weather-sunny",
"state": {
"on": "mdi:weather-lightning-rainy"
}
},
"grid_services_power": { "grid_services_power": {
"default": "mdi:transmission-tower" "default": "mdi:transmission-tower"
}, },

View File

@ -391,6 +391,9 @@
"components_grid_services_enabled": { "components_grid_services_enabled": {
"name": "Grid services enabled" "name": "Grid services enabled"
}, },
"storm_mode_active": {
"name": "Storm watch active"
},
"grid_services_active": { "grid_services_active": {
"name": "Grid services active" "name": "Grid services active"
}, },

View File

@ -137,6 +137,52 @@
'state': 'off', 'state': 'off',
}) })
# --- # ---
# name: test_binary_sensor[binary_sensor.energy_site_storm_watch_active-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': None,
'config_entry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'binary_sensor',
'entity_category': None,
'entity_id': 'binary_sensor.energy_site_storm_watch_active',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'options': dict({
}),
'original_device_class': None,
'original_icon': None,
'original_name': 'Storm watch active',
'platform': 'tesla_fleet',
'previous_unique_id': None,
'supported_features': 0,
'translation_key': 'storm_mode_active',
'unique_id': '123456-storm_mode_active',
'unit_of_measurement': None,
})
# ---
# name: test_binary_sensor[binary_sensor.energy_site_storm_watch_active-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'friendly_name': 'Energy Site Storm watch active',
}),
'context': <ANY>,
'entity_id': 'binary_sensor.energy_site_storm_watch_active',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'off',
})
# ---
# name: test_binary_sensor[binary_sensor.test_battery_heater-entry] # name: test_binary_sensor[binary_sensor.test_battery_heater-entry]
EntityRegistryEntrySnapshot({ EntityRegistryEntrySnapshot({
'aliases': set({ 'aliases': set({
@ -1252,6 +1298,19 @@
'state': 'off', 'state': 'off',
}) })
# --- # ---
# name: test_binary_sensor_refresh[binary_sensor.energy_site_storm_watch_active-statealt]
StateSnapshot({
'attributes': ReadOnlyDict({
'friendly_name': 'Energy Site Storm watch active',
}),
'context': <ANY>,
'entity_id': 'binary_sensor.energy_site_storm_watch_active',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'off',
})
# ---
# name: test_binary_sensor_refresh[binary_sensor.test_battery_heater-statealt] # name: test_binary_sensor_refresh[binary_sensor.test_battery_heater-statealt]
StateSnapshot({ StateSnapshot({
'attributes': ReadOnlyDict({ 'attributes': ReadOnlyDict({

View File

@ -137,6 +137,52 @@
'state': 'off', 'state': 'off',
}) })
# --- # ---
# name: test_binary_sensor[binary_sensor.energy_site_storm_watch_active-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': None,
'config_entry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'binary_sensor',
'entity_category': None,
'entity_id': 'binary_sensor.energy_site_storm_watch_active',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'options': dict({
}),
'original_device_class': None,
'original_icon': None,
'original_name': 'Storm watch active',
'platform': 'teslemetry',
'previous_unique_id': None,
'supported_features': 0,
'translation_key': 'storm_mode_active',
'unique_id': '123456-storm_mode_active',
'unit_of_measurement': None,
})
# ---
# name: test_binary_sensor[binary_sensor.energy_site_storm_watch_active-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'friendly_name': 'Energy Site Storm watch active',
}),
'context': <ANY>,
'entity_id': 'binary_sensor.energy_site_storm_watch_active',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'off',
})
# ---
# name: test_binary_sensor[binary_sensor.test_battery_heater-entry] # name: test_binary_sensor[binary_sensor.test_battery_heater-entry]
EntityRegistryEntrySnapshot({ EntityRegistryEntrySnapshot({
'aliases': set({ 'aliases': set({
@ -1252,6 +1298,19 @@
'state': 'off', 'state': 'off',
}) })
# --- # ---
# name: test_binary_sensor_refresh[binary_sensor.energy_site_storm_watch_active-statealt]
StateSnapshot({
'attributes': ReadOnlyDict({
'friendly_name': 'Energy Site Storm watch active',
}),
'context': <ANY>,
'entity_id': 'binary_sensor.energy_site_storm_watch_active',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'off',
})
# ---
# name: test_binary_sensor_refresh[binary_sensor.test_battery_heater-statealt] # name: test_binary_sensor_refresh[binary_sensor.test_battery_heater-statealt]
StateSnapshot({ StateSnapshot({
'attributes': ReadOnlyDict({ 'attributes': ReadOnlyDict({

View File

@ -137,6 +137,52 @@
'state': 'off', 'state': 'off',
}) })
# --- # ---
# name: test_binary_sensors[binary_sensor.energy_site_storm_watch_active-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': None,
'config_entry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'binary_sensor',
'entity_category': None,
'entity_id': 'binary_sensor.energy_site_storm_watch_active',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'options': dict({
}),
'original_device_class': None,
'original_icon': None,
'original_name': 'Storm watch active',
'platform': 'tessie',
'previous_unique_id': None,
'supported_features': 0,
'translation_key': 'storm_mode_active',
'unique_id': '123456-storm_mode_active',
'unit_of_measurement': None,
})
# ---
# name: test_binary_sensors[binary_sensor.energy_site_storm_watch_active-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'friendly_name': 'Energy Site Storm watch active',
}),
'context': <ANY>,
'entity_id': 'binary_sensor.energy_site_storm_watch_active',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'off',
})
# ---
# name: test_binary_sensors[binary_sensor.test_auto_seat_climate_left-entry] # name: test_binary_sensors[binary_sensor.test_auto_seat_climate_left-entry]
EntityRegistryEntrySnapshot({ EntityRegistryEntrySnapshot({
'aliases': set({ 'aliases': set({