Skip to content

Commit

Permalink
fix soc data
Browse files Browse the repository at this point in the history
  • Loading branch information
tillsteinbach committed Jan 21, 2025
1 parent 34b0b9d commit 0dbc17c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/carconnectivity_connectors/skoda/mqtt_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,8 @@ def _on_message_callback(self, client: Client, obj: Any, msg: MQTTMessage) -> No
# pylint: disable-next=protected-access
vehicle.charging.power._set_value(value=0, measured=measured_at, unit=Power.KW)
if 'soc' in data['data'] and data['data']['soc'] is not None:
if isinstance(data['data']['soc'], str):
data['data']['soc'] = int(data['data']['soc'])
electric_drive.level._set_value(measured=measured_at, value=data['data']['soc']) # pylint: disable=protected-access
if 'chargedRange' in data['data'] and data['data']['chargedRange'] is not None:
# pylint: disable-next=protected-access
Expand Down

0 comments on commit 0dbc17c

Please sign in to comment.