Giter Site home page Giter Site logo

Support Canada about ha_kia_hyundai HOT 5 CLOSED

dahlb avatar dahlb commented on May 28, 2024
Support Canada

from ha_kia_hyundai.

Comments (5)

dahlb avatar dahlb commented on May 28, 2024

please comment if you are in canada and willing to verify the implementation there

from ha_kia_hyundai.

speedking456 avatar speedking456 commented on May 28, 2024

I'm in Canada an have a vehicle registered with uvo. I have python experience as well so I'm more than willing to chip in where I can.

from ha_kia_hyundai.

dahlb avatar dahlb commented on May 28, 2024

@speedking456 that's very exciting, I'll start on a API wrapper for CA today and should have something for you to try in a day or two from the pypi package

from ha_kia_hyundai.

dahlb avatar dahlb commented on May 28, 2024

@speedking456 I think the wrapper is ready, can you run it in the python console to improve the wrapper's documentation?

pip3 install kia-uvo-api==1.1.7

from a python console run

import logging
from kia_uvo_api import CaKia
logger = logging.getLogger("kia_uvo_api.ca")
logger.setLevel(logging.DEBUG)
ch = logging.StreamHandler()
ch.setLevel(logging.DEBUG)
formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
ch.setFormatter(formatter)
logger.addHandler(ch)
import asyncio
async def testing():
  ca = CaKia()
  pin = "PIN"
  login_response = await ca.login("user", "pass")
  access_token = login_response["access_token"]
  vehicles = await ca.get_vehicles(access_token)
  vehicle_id = vehicles["vehicles"][0]["vehicleId"]
  await ca.get_cached_vehicle_status(access_token=access_token, vehicle_id=vehicle_id)
  await ca.get_next_service_status(access_token=access_token, vehicle_id=vehicle_id)
  pin_token = await ca.get_pin_token(access_token=access_token, pin=pin)
  await ca.get_location(access_token=access_token, vehicle_id=vehicle_id, pin=pin, pin_token=pin_token)

asyncio.run(testing())

but with real username, password, and PIN. the console should show all the responses raw json; if you can post the responses I'll add them to the API files for reference like I did for the us kia version https://github.com/dahlb/kia_uvo/blob/master/kia_uvo_api/src/kia_uvo_api/us_kia.py#L139

BE SURE TO REMOVE ANY PII like vin, but I'm not sure which PII will be in the responses, you could email it to me at [email protected] if you want a second pair of eyes to check for PII before it's online. Feel free to add the documentation in a PR if you'd like :).

I'll start working on the HA side of changes for CA but that'll take a few days and be much better with the responses for reference.

from ha_kia_hyundai.

dahlb avatar dahlb commented on May 28, 2024

I think I've gotten the bulk of it working for Canada in the integration; it's in master. The service calls are still in F instead of C but I'm hoping to work that out tomorrow. I haven't been able to test it but short of typos I'm pretty confident it'll work, please let me know your experience.

Having those responses documented for the API is still important and will help with the vehicle attributes like model name and debugging.

PS: I'm new to python myself, only been doing it the last month or so for this project. If you notice any best practices or other issues, please let me know and I'll work on improving it.

from ha_kia_hyundai.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.