Skip to content

Commit

Permalink
fix software version, add new sensor with date for production and reg…
Browse files Browse the repository at this point in the history
…istration
  • Loading branch information
Tuen Lee committed Jan 18, 2024
1 parent 5cf2beb commit 77ce561
Showing 1 changed file with 47 additions and 1 deletion.
48 changes: 47 additions & 1 deletion custom_components/polestar_api/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,31 @@ class PolestarSensorDescription(
name="Software Version",
icon="mdi:information-outline",
query="getConsumerCarsV2",
field_name="software/performanceOptimization/value",
field_name="software/version",
native_unit_of_measurement=None,
round_digits=None,
max_value=None,
dict_data=None
),
PolestarSensorDescription(
key="software_version_release",
name="Software Released",
icon="mdi:information-outline",
query="getConsumerCarsV2",
field_name="software/versionTimestamp",
state_class=SensorStateClass.MEASUREMENT,
device_class=SensorDeviceClass.TIMESTAMP,
native_unit_of_measurement=None,
round_digits=None,
max_value=None,
dict_data=None
),
PolestarSensorDescription(
key="registration_date",
name="Registration Date",
icon="mdi:numeric-1-box",
query="getConsumerCarsV2",
field_name="registrationDate",
native_unit_of_measurement=None,
round_digits=None,
max_value=None,
Expand All @@ -295,6 +319,28 @@ class PolestarSensorDescription(
max_value=None,
dict_data=None
),
PolestarSensorDescription(
key="factory_complete",
name="Factory Complete Date",
icon="mdi:numeric-1-box",
query="getConsumerCarsV2",
field_name="factoryCompleteDate",
native_unit_of_measurement=None,
round_digits=None,
max_value=None,
dict_data=None
),
PolestarSensorDescription(
key="internal_vebicle_id",
name="Internal Vehicle ID",
icon="mdi:numeric-1-box",
query="getConsumerCarsV2",
field_name="internalVehicleIdentifier",
native_unit_of_measurement=None,
round_digits=None,
max_value=None,
dict_data=None
),
PolestarSensorDescription(
key="estimated_fully_charged_time",
name="Time Full Charged",
Expand Down

0 comments on commit 77ce561

Please sign in to comment.