Skip to content

Commit

Permalink
sensor to indicate remaining charging time, requires the correspondin…
Browse files Browse the repository at this point in the history
…g functions in pyporscheconnectapi
  • Loading branch information
fredriklj committed Jan 25, 2025
1 parent e4c0c3d commit b250f9f
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 0 deletions.
9 changes: 9 additions & 0 deletions custom_components/porscheconnect/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,15 @@ class PorscheSensorEntityDescription(SensorEntityDescription):
native_unit_of_measurement=UnitOfSpeed.KILOMETERS_PER_HOUR,
is_available=lambda v: v.has_electric_drivetrain,
),
PorscheSensorEntityDescription(
key="charging_finished",
translation_key="charging_finished",
measurement_node="BATTERY_CHARGING_STATE",
measurement_leaf="endsAt",
icon="mdi:clock-end",
device_class=SensorDeviceClass.TIMESTAMP,
is_available=lambda v: v.has_electric_drivetrain,
),
PorscheSensorEntityDescription(
key="charging_power",
translation_key="charging_power",
Expand Down
1 change: 1 addition & 0 deletions custom_components/porscheconnect/services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ climatisation_start:
temperature:
example: "21"
required: false
default: 21
selector:
number:
min: 15
Expand Down
3 changes: 3 additions & 0 deletions custom_components/porscheconnect/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@
"charging_rate": {
"name": "Charging rate"
},
"charging_finished": {
"name": "Charging ends"
},
"remaining_range_electric": {
"name": "Remaining range electric"
},
Expand Down
3 changes: 3 additions & 0 deletions custom_components/porscheconnect/translations/sv.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@
"charging_rate": {
"name": "Laddhastighet"
},
"charging_finished": {
"name": "Laddning klar"
},
"remaining_range_electric": {
"name": "Räckvidd på batteri"
},
Expand Down

0 comments on commit b250f9f

Please sign in to comment.