From eccb7bb55ff1033e71d8fdfcee1bf2000359846c Mon Sep 17 00:00:00 2001 From: Brett Adams Date: Wed, 25 Sep 2024 17:05:33 +1000 Subject: [PATCH] Add Storm watch active to Tesla integrations (#126704) --- .../components/tesla_fleet/binary_sensor.py | 1 + .../components/tesla_fleet/icons.json | 6 ++ .../components/tesla_fleet/strings.json | 3 + .../components/teslemetry/binary_sensor.py | 1 + .../components/teslemetry/icons.json | 6 ++ .../components/teslemetry/strings.json | 3 + .../components/tessie/binary_sensor.py | 1 + homeassistant/components/tessie/icons.json | 6 ++ homeassistant/components/tessie/strings.json | 3 + .../snapshots/test_binary_sensors.ambr | 59 +++++++++++++++++++ .../snapshots/test_binary_sensors.ambr | 59 +++++++++++++++++++ .../tessie/snapshots/test_binary_sensors.ambr | 46 +++++++++++++++ 12 files changed, 194 insertions(+) diff --git a/homeassistant/components/tesla_fleet/binary_sensor.py b/homeassistant/components/tesla_fleet/binary_sensor.py index 2469092513a..b92ef9233d1 100644 --- a/homeassistant/components/tesla_fleet/binary_sensor.py +++ b/homeassistant/components/tesla_fleet/binary_sensor.py @@ -165,6 +165,7 @@ VEHICLE_DESCRIPTIONS: tuple[TeslaFleetBinarySensorEntityDescription, ...] = ( ENERGY_LIVE_DESCRIPTIONS: tuple[BinarySensorEntityDescription, ...] = ( BinarySensorEntityDescription(key="backup_capable"), BinarySensorEntityDescription(key="grid_services_active"), + BinarySensorEntityDescription(key="storm_mode_active"), ) diff --git a/homeassistant/components/tesla_fleet/icons.json b/homeassistant/components/tesla_fleet/icons.json index aa5c1c920d4..3e842c0997a 100644 --- a/homeassistant/components/tesla_fleet/icons.json +++ b/homeassistant/components/tesla_fleet/icons.json @@ -7,6 +7,12 @@ "on": "mdi:hvac" } }, + "storm_mode_active": { + "default": "mdi:weather-sunny", + "state": { + "on": "mdi:weather-lightning-rainy" + } + }, "vehicle_state_is_user_present": { "state": { "off": "mdi:account-remove-outline", diff --git a/homeassistant/components/tesla_fleet/strings.json b/homeassistant/components/tesla_fleet/strings.json index 8f7f91b4960..09040de13b0 100644 --- a/homeassistant/components/tesla_fleet/strings.json +++ b/homeassistant/components/tesla_fleet/strings.json @@ -64,6 +64,9 @@ "state": { "name": "Status" }, + "storm_mode_active": { + "name": "Storm watch active" + }, "vehicle_state_dashcam_state": { "name": "Dashcam" }, diff --git a/homeassistant/components/teslemetry/binary_sensor.py b/homeassistant/components/teslemetry/binary_sensor.py index e3f9a5716f6..b51a67a0b4e 100644 --- a/homeassistant/components/teslemetry/binary_sensor.py +++ b/homeassistant/components/teslemetry/binary_sensor.py @@ -165,6 +165,7 @@ VEHICLE_DESCRIPTIONS: tuple[TeslemetryBinarySensorEntityDescription, ...] = ( ENERGY_LIVE_DESCRIPTIONS: tuple[BinarySensorEntityDescription, ...] = ( BinarySensorEntityDescription(key="backup_capable"), BinarySensorEntityDescription(key="grid_services_active"), + BinarySensorEntityDescription(key="storm_mode_active"), ) diff --git a/homeassistant/components/teslemetry/icons.json b/homeassistant/components/teslemetry/icons.json index 501755bb691..6559acf89dc 100644 --- a/homeassistant/components/teslemetry/icons.json +++ b/homeassistant/components/teslemetry/icons.json @@ -7,6 +7,12 @@ "on": "mdi:hvac" } }, + "storm_mode_active": { + "default": "mdi:weather-sunny", + "state": { + "on": "mdi:weather-lightning-rainy" + } + }, "vehicle_state_is_user_present": { "state": { "off": "mdi:account-remove-outline", diff --git a/homeassistant/components/teslemetry/strings.json b/homeassistant/components/teslemetry/strings.json index b8d07c992a8..b7ba06fbce4 100644 --- a/homeassistant/components/teslemetry/strings.json +++ b/homeassistant/components/teslemetry/strings.json @@ -56,6 +56,9 @@ "state": { "name": "Status" }, + "storm_mode_active": { + "name": "Storm watch active" + }, "vehicle_state_dashcam_state": { "name": "Dashcam" }, diff --git a/homeassistant/components/tessie/binary_sensor.py b/homeassistant/components/tessie/binary_sensor.py index f425cd10134..fd6565b62b7 100644 --- a/homeassistant/components/tessie/binary_sensor.py +++ b/homeassistant/components/tessie/binary_sensor.py @@ -163,6 +163,7 @@ VEHICLE_DESCRIPTIONS: tuple[TessieBinarySensorEntityDescription, ...] = ( ENERGY_LIVE_DESCRIPTIONS: tuple[BinarySensorEntityDescription, ...] = ( BinarySensorEntityDescription(key="backup_capable"), BinarySensorEntityDescription(key="grid_services_active"), + BinarySensorEntityDescription(key="storm_mode_active"), ) diff --git a/homeassistant/components/tessie/icons.json b/homeassistant/components/tessie/icons.json index a967c70e285..0ae087f98e2 100644 --- a/homeassistant/components/tessie/icons.json +++ b/homeassistant/components/tessie/icons.json @@ -22,6 +22,12 @@ "climate_state_auto_steering_wheel_heat": { "default": "mdi:steering" }, + "storm_mode_active": { + "default": "mdi:weather-sunny", + "state": { + "on": "mdi:weather-lightning-rainy" + } + }, "grid_services_power": { "default": "mdi:transmission-tower" }, diff --git a/homeassistant/components/tessie/strings.json b/homeassistant/components/tessie/strings.json index df488523900..c7408df1ddb 100644 --- a/homeassistant/components/tessie/strings.json +++ b/homeassistant/components/tessie/strings.json @@ -391,6 +391,9 @@ "components_grid_services_enabled": { "name": "Grid services enabled" }, + "storm_mode_active": { + "name": "Storm watch active" + }, "grid_services_active": { "name": "Grid services active" }, diff --git a/tests/components/tesla_fleet/snapshots/test_binary_sensors.ambr b/tests/components/tesla_fleet/snapshots/test_binary_sensors.ambr index 05ef4879de6..479d647e1c7 100644 --- a/tests/components/tesla_fleet/snapshots/test_binary_sensors.ambr +++ b/tests/components/tesla_fleet/snapshots/test_binary_sensors.ambr @@ -137,6 +137,52 @@ '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': , + 'device_class': None, + 'device_id': , + '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': , + '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': , + 'entity_id': 'binary_sensor.energy_site_storm_watch_active', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'off', + }) +# --- # name: test_binary_sensor[binary_sensor.test_battery_heater-entry] EntityRegistryEntrySnapshot({ 'aliases': set({ @@ -1252,6 +1298,19 @@ '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': , + 'entity_id': 'binary_sensor.energy_site_storm_watch_active', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'off', + }) +# --- # name: test_binary_sensor_refresh[binary_sensor.test_battery_heater-statealt] StateSnapshot({ 'attributes': ReadOnlyDict({ diff --git a/tests/components/teslemetry/snapshots/test_binary_sensors.ambr b/tests/components/teslemetry/snapshots/test_binary_sensors.ambr index 6f35fe9da25..383db58b336 100644 --- a/tests/components/teslemetry/snapshots/test_binary_sensors.ambr +++ b/tests/components/teslemetry/snapshots/test_binary_sensors.ambr @@ -137,6 +137,52 @@ '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': , + 'device_class': None, + 'device_id': , + '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': , + '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': , + 'entity_id': 'binary_sensor.energy_site_storm_watch_active', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'off', + }) +# --- # name: test_binary_sensor[binary_sensor.test_battery_heater-entry] EntityRegistryEntrySnapshot({ 'aliases': set({ @@ -1252,6 +1298,19 @@ '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': , + 'entity_id': 'binary_sensor.energy_site_storm_watch_active', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'off', + }) +# --- # name: test_binary_sensor_refresh[binary_sensor.test_battery_heater-statealt] StateSnapshot({ 'attributes': ReadOnlyDict({ diff --git a/tests/components/tessie/snapshots/test_binary_sensors.ambr b/tests/components/tessie/snapshots/test_binary_sensors.ambr index e8912bb0e7f..6c0da044df2 100644 --- a/tests/components/tessie/snapshots/test_binary_sensors.ambr +++ b/tests/components/tessie/snapshots/test_binary_sensors.ambr @@ -137,6 +137,52 @@ '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': , + 'device_class': None, + 'device_id': , + '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': , + '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': , + 'entity_id': 'binary_sensor.energy_site_storm_watch_active', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'off', + }) +# --- # name: test_binary_sensors[binary_sensor.test_auto_seat_climate_left-entry] EntityRegistryEntrySnapshot({ 'aliases': set({