Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix battery sensor to align with new structure #54

Merged
merged 2 commits into from
Dec 9, 2024

Conversation

themoosman
Copy link
Contributor

The battery sensor in HA has been broken for quite a while. Upon investigation, the Vehicles API response has changed. battery is no longer under mil.

Here is a current JSON payload from the API.

    {
      "model": { "make": "HONDA", "name": "Pilot", "year": 2019 },
      "nickName": "Pilot",
      "standardEngine": "3.5L V6",
      "vin": "8675309",
      "imei": "1234567890",
      "stats": {
        "localTimeZone": "-0600",
        "lastUpdated": "2024-12-08T22:34:01.000Z",
        "odometer": 3332,
        "location": {
          "lat": 123.000,
          "lon": -123.000,
          "heading": 36,
          "address": null
        },
        "fuelLevel": 86.4857712277679,
        "isRunning": false,
        "speed": 0,
        "mil": {
          "milOn": false,
          "lastUpdated": "2023-10-15T03:01:00.000Z",
          "qualifiedDtcList": []
        },
        "battery": {
          "status": "normal",
          "lastUpdated": "2024-12-01T22:34:44.000Z"
        }
      }
    }

This PR maps the sensor to the new JSON structure and updates the unit tests.

@themoosman themoosman changed the title Fix battery to align with new structure Fix battery sensor to align with new structure Dec 9, 2024
@mandarons mandarons merged commit ece94de into mandarons:main Dec 9, 2024
4 checks passed
@themoosman themoosman deleted the fix_battery_sensor branch December 9, 2024 23:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants