Skip to content

Commit

Permalink
Add back in frunk, trunk, charge port door sensors as state-icon need…
Browse files Browse the repository at this point in the history
…s them for picture entity cards.
  • Loading branch information
borski committed Jan 25, 2024
1 parent 73ba2d3 commit cf6f7c4
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 2 deletions.
24 changes: 24 additions & 0 deletions custom_components/lucidmotors/binary_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,30 @@ class LucidBinarySensorEntityDescription(BinarySensorEntityDescription):
is_on_fn=lambda vehicle: vehicle.state.body.rear_right_door
!= DoorState.DOOR_STATE_CLOSED,
),
"frunk": LucidBinarySensorEntityDescription(
key="front_cargo",
key_path=["state", "body"],
translation_key="front_cargo",
icon="mdi:door",
device_class=BinarySensorDeviceClass.DOOR,
is_on_fn=lambda vehicle: vehicle.state.body.front_cargo != DoorState.DOOR_STATE_CLOSED,
),
"trunk": LucidBinarySensorEntityDescription(
key="rear_cargo",
key_path=["state", "body"],
translation_key="rear_cargo",
icon="mdi:door",
device_class=BinarySensorDeviceClass.DOOR,
is_on_fn=lambda vehicle: vehicle.state.body.rear_cargo != DoorState.DOOR_STATE_CLOSED,
),
"charge_port_door": LucidBinarySensorEntityDescription(
key="charge_port",
key_path=["state", "body"],
translation_key="charge_port_door",
icon="mdi:door",
device_class=BinarySensorDeviceClass.DOOR,
is_on_fn=lambda vehicle: vehicle.state.body.charge_port != DoorState.DOOR_STATE_CLOSED,
),
"walkaway_lock": LucidBinarySensorEntityDescription(
key="walkaway_lock",
key_path=["state", "body"],
Expand Down
4 changes: 2 additions & 2 deletions custom_components/lucidmotors/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
"iot_class": "cloud_polling",
"issue_tracker": "https://github.com/borski/ha-lucidmotors/issues",
"requirements": [
"lucidmotors==1.0.0",
"lucidmotors==1.0.1",
"markdownify==0.11.6"
],
"ssdp": [],
"version": "1.0.0",
"version": "1.0.1",
"zeroconf": []
}
9 changes: 9 additions & 0 deletions custom_components/lucidmotors/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,15 @@
"rear_right_door": {
"name": "Rear right door"
},
"front_cargo": {
"name": "Frunk"
},
"rear_cargo": {
"name": "Trunk"
},
"charge_port_door": {
"name": "Charge port door"
},
"walkaway_lock": {
"name": "Walkaway lock"
},
Expand Down
9 changes: 9 additions & 0 deletions custom_components/lucidmotors/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@
},
"entity": {
"binary_sensor": {
"charge_port_door": {
"name": "Charge port door"
},
"front_cargo": {
"name": "Frunk"
},
"front_left_door": {
"name": "Front left door"
},
Expand All @@ -32,6 +38,9 @@
"hvac_power": {
"name": "HVAC power"
},
"rear_cargo": {
"name": "Trunk"
},
"rear_left_door": {
"name": "Rear left door"
},
Expand Down

0 comments on commit cf6f7c4

Please sign in to comment.