Skip to main content

Python Boilerplate contains all the boilerplate you need to create a Python package.

Project description

Introduction

This is a Kia UVO and Hyundai Bluelink written in python. It is primary consumed by home assistant. If you are looking for a home assistant Kia / Hyundai implementation please look here: https://github.com/fuatakgun/kia_uvo. Much of this base code came from reading bluelinky and contributions to the kia_uvo home assistant project.

Usage

This package is designed to simplify the complexity of using multiple regions. It attempts to standardize the usage regardless of what brand or region the car is in. That isn’t always possible though, in particular some features differ from one to the next.

Python 3.9 or newer is required to use this package. Vehicle manager is the key class that is called to manage the vehicle lists. One vehicle manager should be used per login. Key data points required to instantiate vehicle manager are:

region: int
brand: int,
username: str
password: str
pin: str (required for CA, and potentially USA, otherwise pass a blank string)

Key values for the int exist in the constant(https://github.com/fuatakgun/hyundai_kia_connect_api/blob/master/hyundai_kia_connect_api/const.py) file as:

REGIONS = {1: REGION_EUROPE, 2: REGION_CANADA, 3: REGION_USA}
BRANDS = {1: BRAND_KIA, 2: BRAND_HYUNDAI}

Once this is done you can now make the following calls against the vehicle manager:

#Checks the token is still valid and updates it if not.  Should be called before anything else.
check_and_refresh_token(self)

#Ideal fresh command. Checks if the car has been updated since the time in seconds provided.  If so does a cached update. If not force calls the car.
check_and_force_update_vehicles(self, force_refresh_interval) # Interval in seconds - consider API Rate Limits https://github.com/Hacksore/bluelinky/wiki/API-Rate-Limits

#Used to return a specific vehicle object:
get_vehicle(self, vehicle_id)

#Updates all cars with what is cached in the cloud:
update_all_vehicles_with_cached_state(self)

#Updates a specific car with cached state:
update_vehicle_with_cached_state(self, vehicle_id)

#Force refreshes all cars:
force_refresh_all_vehicles_states(self)

#Force refreshes a single car:
force_refresh_vehicles_states(self, vehicle_id)

An example call would be:

from hyundai_kia_connect_api import *
vm = VehicleManager(region=2, brand=1, username="username@gmail.com", password="password", pin="1234")
vm.check_and_refresh_token()
vm.update_all_vehicles_with_cached_state()
print(vm.vehicles)

If geolocation is required you can also allow this by running:

vm = VehicleManager(region=2, brand=1, username="username@gmail.com", password="password", pin="1234", geocode_api_enable=True, geocode_api_use_email=True)

This will populate the address of the vehicle in the vehicle instance.

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hyundai_kia_connect_api-1.41.4.tar.gz (31.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hyundai_kia_connect_api-1.41.4-py2.py3-none-any.whl (32.6 kB view details)

Uploaded Python 2Python 3

File details

Details for the file hyundai_kia_connect_api-1.41.4.tar.gz.

File metadata

File hashes

Hashes for hyundai_kia_connect_api-1.41.4.tar.gz
Algorithm Hash digest
SHA256 d5e14a311f804c420d2e196bc11db72ec8dc3cab782706c4e9513fc50a01d62e
MD5 ee5d1b560dd7110bf7ecabbdd2656094
BLAKE2b-256 b0fab9cbee9344edae7cd76ce98c1f8973462100671bc2e2135ee536c92b485f

See more details on using hashes here.

File details

Details for the file hyundai_kia_connect_api-1.41.4-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for hyundai_kia_connect_api-1.41.4-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 2b479c54e80fa5330097f3aef651b519a35223792c9c76da12567f7a75a3f35d
MD5 d8b2984a8b1629f2042bf7178f2483c3
BLAKE2b-256 15c628e812471e2c91d0363aa856248f1897b850ec126b79e273719ab5731004

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page