Skip to content

Commit

Permalink
Add Tesla Fleet grid status (#126438)
Browse files Browse the repository at this point in the history
* Make Changes.

* Change to match suggested changes.

* add Possible States to island status

* remove storm watch active sensor.

* Update the test_*.ambr files

* Update *.ambr files

* Add more infromation to Grid Status

* Remove storm mode strings and icons
  • Loading branch information
JEMcats authored Oct 7, 2024
1 parent 4c175a3 commit eac930a
Show file tree
Hide file tree
Showing 5 changed files with 114 additions and 480 deletions.
10 changes: 10 additions & 0 deletions homeassistant/components/tesla_fleet/icons.json
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,16 @@
},
"wall_connector_state": {
"default": "mdi:ev-station"
},
"island_status": {
"default": "mdi:help-circle",
"state": {
"on_grid": "mdi:transmission-tower",
"off_grid": "mdi:transmission-tower-off",
"off_grid_unintentional": "mdi:transmission-tower-off",
"island_status_unknown": "mdi:help-circle",
"off_grid_intentional": "mdi:account-cancel"
}
}
},
"switch": {
Expand Down
11 changes: 11 additions & 0 deletions homeassistant/components/tesla_fleet/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,17 @@ class TeslaFleetTimeEntityDescription(SensorEntityDescription):
device_class=SensorDeviceClass.POWER,
entity_registry_enabled_default=False,
),
SensorEntityDescription(
key="island_status",
options=[
"island_status_unknown",
"on_grid",
"off_grid",
"off_grid_unintentional",
"off_grid_intentional",
],
device_class=SensorDeviceClass.ENUM,
),
)

WALL_CONNECTOR_DESCRIPTIONS: tuple[SensorEntityDescription, ...] = (
Expand Down
10 changes: 10 additions & 0 deletions homeassistant/components/tesla_fleet/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,16 @@
"vehicle_state_odometer": {
"name": "Odometer"
},
"island_status": {
"name": "Grid Status",
"state": {
"island_status_unknown": "Unknown",
"on_grid": "Connected",
"off_grid": "Disconnected",
"off_grid_unintentional": "Disconnected unintentionally",
"off_grid_intentional": "Disconnected intentionally"
}
},
"vehicle_state_tpms_pressure_fl": {
"name": "Tire pressure front left"
},
Expand Down
Loading

0 comments on commit eac930a

Please sign in to comment.