hyundai-kia-connect-api 3.34.4__py2.py3-none-any.whl → 3.35.1__py2.py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- hyundai_kia_connect_api/ApiImplType1.py +124 -5
- hyundai_kia_connect_api/KiaUvoApiAU.py +0 -55
- hyundai_kia_connect_api/KiaUvoApiEU.py +1 -75
- {hyundai_kia_connect_api-3.34.4.dist-info → hyundai_kia_connect_api-3.35.1.dist-info}/METADATA +1 -1
- {hyundai_kia_connect_api-3.34.4.dist-info → hyundai_kia_connect_api-3.35.1.dist-info}/RECORD +10 -10
- {hyundai_kia_connect_api-3.34.4.dist-info → hyundai_kia_connect_api-3.35.1.dist-info}/WHEEL +0 -0
- {hyundai_kia_connect_api-3.34.4.dist-info → hyundai_kia_connect_api-3.35.1.dist-info}/entry_points.txt +0 -0
- {hyundai_kia_connect_api-3.34.4.dist-info → hyundai_kia_connect_api-3.35.1.dist-info}/licenses/AUTHORS.rst +0 -0
- {hyundai_kia_connect_api-3.34.4.dist-info → hyundai_kia_connect_api-3.35.1.dist-info}/licenses/LICENSE +0 -0
- {hyundai_kia_connect_api-3.34.4.dist-info → hyundai_kia_connect_api-3.35.1.dist-info}/top_level.txt +0 -0
@@ -8,14 +8,15 @@ from typing import Optional
|
|
8
8
|
from time import sleep
|
9
9
|
|
10
10
|
|
11
|
-
from .ApiImpl import
|
11
|
+
from .ApiImpl import (
|
12
|
+
ApiImpl,
|
13
|
+
ScheduleChargingClimateRequestOptions,
|
14
|
+
ClimateRequestOptions,
|
15
|
+
)
|
12
16
|
from .Token import Token
|
13
17
|
from .Vehicle import Vehicle
|
14
18
|
|
15
|
-
from .utils import
|
16
|
-
get_child_value,
|
17
|
-
parse_datetime,
|
18
|
-
)
|
19
|
+
from .utils import get_child_value, parse_datetime, get_index_into_hex_temp
|
19
20
|
|
20
21
|
from .const import (
|
21
22
|
DOMAIN,
|
@@ -474,6 +475,7 @@ class ApiImplType1(ApiImpl):
|
|
474
475
|
},
|
475
476
|
]
|
476
477
|
}
|
478
|
+
_LOGGER.debug(f"{DOMAIN} - Set Charge Limits Body: {body}")
|
477
479
|
response = requests.post(
|
478
480
|
url,
|
479
481
|
json=body,
|
@@ -704,3 +706,120 @@ class ApiImplType1(ApiImpl):
|
|
704
706
|
_check_response_for_errors(response)
|
705
707
|
token.device_id = self._get_device_id(self._get_stamp())
|
706
708
|
return response["msgId"]
|
709
|
+
|
710
|
+
def start_climate(
|
711
|
+
self, token: Token, vehicle: Vehicle, options: ClimateRequestOptions
|
712
|
+
) -> str:
|
713
|
+
url = self.SPA_API_URL + "vehicles/" + vehicle.id + "/control/temperature"
|
714
|
+
|
715
|
+
# Defaults are located here to be region specific
|
716
|
+
|
717
|
+
if options.set_temp is None:
|
718
|
+
options.set_temp = 21
|
719
|
+
if options.duration is None:
|
720
|
+
options.duration = 5
|
721
|
+
if options.defrost is None:
|
722
|
+
options.defrost = False
|
723
|
+
if options.climate is None:
|
724
|
+
options.climate = True
|
725
|
+
if options.heating is None:
|
726
|
+
options.heating = 0
|
727
|
+
if not vehicle.ccu_ccs2_protocol_support:
|
728
|
+
hex_set_temp = get_index_into_hex_temp(
|
729
|
+
self.temperature_range.index(options.set_temp)
|
730
|
+
)
|
731
|
+
|
732
|
+
payload = {
|
733
|
+
"action": "start",
|
734
|
+
"hvacType": 0,
|
735
|
+
"options": {
|
736
|
+
"defrost": options.defrost,
|
737
|
+
"heating1": int(options.heating),
|
738
|
+
},
|
739
|
+
"tempCode": hex_set_temp,
|
740
|
+
"unit": "C",
|
741
|
+
}
|
742
|
+
_LOGGER.debug(f"{DOMAIN} - Start Climate Action Request: {payload}")
|
743
|
+
response = requests.post(
|
744
|
+
url,
|
745
|
+
json=payload,
|
746
|
+
headers=self._get_authenticated_headers(
|
747
|
+
token, vehicle.ccu_ccs2_protocol_support
|
748
|
+
),
|
749
|
+
).json()
|
750
|
+
else:
|
751
|
+
url = (
|
752
|
+
self.SPA_API_URL_V2
|
753
|
+
+ "vehicles/"
|
754
|
+
+ vehicle.id
|
755
|
+
+ "/ccs2/control/temperature"
|
756
|
+
)
|
757
|
+
payload = {
|
758
|
+
"command": "start",
|
759
|
+
"ignitionDuration:": options.duration,
|
760
|
+
"strgWhlHeating": options.steering_wheel,
|
761
|
+
"hvacTempType": 1,
|
762
|
+
"hvacTemp": options.set_temp,
|
763
|
+
"sideRearMirrorHeating": 1,
|
764
|
+
"drvSeatLoc": "R",
|
765
|
+
"seatClimateInfo": {
|
766
|
+
"drvSeatClimateState": options.front_left_seat,
|
767
|
+
"psgSeatClimateState": options.front_right_seat,
|
768
|
+
"rrSeatClimateState": options.rear_right_seat,
|
769
|
+
"rlSeatClimateState": options.rear_left_seat,
|
770
|
+
},
|
771
|
+
"tempUnit": "C",
|
772
|
+
"windshieldFrontDefogState": options.defrost,
|
773
|
+
}
|
774
|
+
_LOGGER.debug(f"{DOMAIN} - Start Climate Action Request: {payload}")
|
775
|
+
response = requests.post(
|
776
|
+
url,
|
777
|
+
json=payload,
|
778
|
+
headers=self._get_control_headers(token, vehicle),
|
779
|
+
).json()
|
780
|
+
_LOGGER.debug(f"{DOMAIN} - Start Climate Action Response: {response}")
|
781
|
+
_check_response_for_errors(response)
|
782
|
+
token.device_id = self._get_device_id(self._get_stamp())
|
783
|
+
return response["msgId"]
|
784
|
+
|
785
|
+
def stop_climate(self, token: Token, vehicle: Vehicle) -> str:
|
786
|
+
if not vehicle.ccu_ccs2_protocol_support:
|
787
|
+
url = self.SPA_API_URL + "vehicles/" + vehicle.id + "/control/temperature"
|
788
|
+
payload = {
|
789
|
+
"action": "stop",
|
790
|
+
"hvacType": 0,
|
791
|
+
"options": {
|
792
|
+
"defrost": True,
|
793
|
+
"heating1": 1,
|
794
|
+
},
|
795
|
+
"tempCode": "10H",
|
796
|
+
"unit": "C",
|
797
|
+
}
|
798
|
+
_LOGGER.debug(f"{DOMAIN} - Stop Climate Action Request: {payload}")
|
799
|
+
response = requests.post(
|
800
|
+
url,
|
801
|
+
json=payload,
|
802
|
+
headers=self._get_authenticated_headers(
|
803
|
+
token, vehicle.ccu_ccs2_protocol_support
|
804
|
+
),
|
805
|
+
).json()
|
806
|
+
else:
|
807
|
+
url = (
|
808
|
+
self.SPA_API_URL_V2
|
809
|
+
+ "vehicles/"
|
810
|
+
+ vehicle.id
|
811
|
+
+ "/ccs2/control/temperature"
|
812
|
+
)
|
813
|
+
payload = {
|
814
|
+
"command": "stop",
|
815
|
+
}
|
816
|
+
_LOGGER.debug(f"{DOMAIN} - Stop Climate Action Request: {payload}")
|
817
|
+
response = requests.post(
|
818
|
+
url,
|
819
|
+
json=payload,
|
820
|
+
headers=self._get_control_headers(token, vehicle),
|
821
|
+
).json()
|
822
|
+
_LOGGER.debug(f"{DOMAIN} - Stop Climate Action Response: {response}")
|
823
|
+
_check_response_for_errors(response)
|
824
|
+
token.device_id = self._get_device_id(self._get_stamp())
|
825
|
+
return response["msgId"]
|
@@ -15,7 +15,6 @@ import requests
|
|
15
15
|
from dateutil import tz
|
16
16
|
|
17
17
|
from .ApiImpl import (
|
18
|
-
ClimateRequestOptions,
|
19
18
|
WindowRequestOptions,
|
20
19
|
)
|
21
20
|
from .ApiImplType1 import ApiImplType1
|
@@ -45,7 +44,6 @@ from .exceptions import (
|
|
45
44
|
)
|
46
45
|
from .utils import (
|
47
46
|
get_child_value,
|
48
|
-
get_index_into_hex_temp,
|
49
47
|
get_hex_temp_into_index,
|
50
48
|
parse_datetime,
|
51
49
|
)
|
@@ -661,59 +659,6 @@ class KiaUvoApiAU(ApiImplType1):
|
|
661
659
|
_check_response_for_errors(response)
|
662
660
|
return response["msgId"]
|
663
661
|
|
664
|
-
def start_climate(
|
665
|
-
self, token: Token, vehicle: Vehicle, options: ClimateRequestOptions
|
666
|
-
) -> str:
|
667
|
-
url = self.SPA_API_URL_V2 + "vehicles/" + vehicle.id + "/control/engine"
|
668
|
-
|
669
|
-
# Defaults are located here to be region specific
|
670
|
-
|
671
|
-
if options.set_temp is None:
|
672
|
-
options.set_temp = 21
|
673
|
-
if options.duration is None:
|
674
|
-
options.duration = 5
|
675
|
-
if options.defrost is None:
|
676
|
-
options.defrost = False
|
677
|
-
if options.climate is None:
|
678
|
-
options.climate = True
|
679
|
-
if options.heating is None:
|
680
|
-
options.heating = 0
|
681
|
-
|
682
|
-
hex_set_temp = get_index_into_hex_temp(
|
683
|
-
self.temperature_range.index(options.set_temp)
|
684
|
-
)
|
685
|
-
|
686
|
-
payload = {
|
687
|
-
"action": "start",
|
688
|
-
"hvacType": 1,
|
689
|
-
"options": {
|
690
|
-
"defrost": options.defrost,
|
691
|
-
"heating1": int(options.heating),
|
692
|
-
},
|
693
|
-
"tempCode": hex_set_temp,
|
694
|
-
"unit": "C",
|
695
|
-
}
|
696
|
-
_LOGGER.debug(f"{DOMAIN} - Start Climate Action Request: {payload}")
|
697
|
-
response = requests.post(
|
698
|
-
url, json=payload, headers=self._get_control_headers(token, vehicle)
|
699
|
-
).json()
|
700
|
-
_LOGGER.debug(f"{DOMAIN} - Start Climate Action Response: {response}")
|
701
|
-
_check_response_for_errors(response)
|
702
|
-
return response["msgId"]
|
703
|
-
|
704
|
-
def stop_climate(self, token: Token, vehicle: Vehicle) -> str:
|
705
|
-
url = self.SPA_API_URL_V2 + "vehicles/" + vehicle.id + "/control/engine"
|
706
|
-
payload = {
|
707
|
-
"action": "stop",
|
708
|
-
}
|
709
|
-
_LOGGER.debug(f"{DOMAIN} - Stop Climate Action Request: {payload}")
|
710
|
-
response = requests.post(
|
711
|
-
url, json=payload, headers=self._get_control_headers(token, vehicle)
|
712
|
-
).json()
|
713
|
-
_LOGGER.debug(f"{DOMAIN} - Stop Climate Action Response: {response}")
|
714
|
-
_check_response_for_errors(response)
|
715
|
-
return response["msgId"]
|
716
|
-
|
717
662
|
def _get_charge_limits(self, token: Token, vehicle: Vehicle) -> dict:
|
718
663
|
# Not currently used as value is in the general get.
|
719
664
|
# Most likely this forces the car the update it.
|
@@ -15,9 +15,7 @@ import requests
|
|
15
15
|
from bs4 import BeautifulSoup
|
16
16
|
from dateutil import tz
|
17
17
|
|
18
|
-
|
19
|
-
ClimateRequestOptions,
|
20
|
-
)
|
18
|
+
|
21
19
|
from .ApiImplType1 import ApiImplType1
|
22
20
|
from .ApiImplType1 import _check_response_for_errors
|
23
21
|
|
@@ -49,7 +47,6 @@ from .exceptions import (
|
|
49
47
|
)
|
50
48
|
from .utils import (
|
51
49
|
get_child_value,
|
52
|
-
get_index_into_hex_temp,
|
53
50
|
get_hex_temp_into_index,
|
54
51
|
parse_datetime,
|
55
52
|
)
|
@@ -854,77 +851,6 @@ class KiaUvoApiEU(ApiImplType1):
|
|
854
851
|
token.device_id = self._get_device_id(self._get_stamp())
|
855
852
|
return response["msgId"]
|
856
853
|
|
857
|
-
def start_climate(
|
858
|
-
self, token: Token, vehicle: Vehicle, options: ClimateRequestOptions
|
859
|
-
) -> str:
|
860
|
-
url = self.SPA_API_URL + "vehicles/" + vehicle.id + "/control/temperature"
|
861
|
-
|
862
|
-
# Defaults are located here to be region specific
|
863
|
-
|
864
|
-
if options.set_temp is None:
|
865
|
-
options.set_temp = 21
|
866
|
-
if options.duration is None:
|
867
|
-
options.duration = 5
|
868
|
-
if options.defrost is None:
|
869
|
-
options.defrost = False
|
870
|
-
if options.climate is None:
|
871
|
-
options.climate = True
|
872
|
-
if options.heating is None:
|
873
|
-
options.heating = 0
|
874
|
-
|
875
|
-
hex_set_temp = get_index_into_hex_temp(
|
876
|
-
self.temperature_range.index(options.set_temp)
|
877
|
-
)
|
878
|
-
|
879
|
-
payload = {
|
880
|
-
"action": "start",
|
881
|
-
"hvacType": 0,
|
882
|
-
"options": {
|
883
|
-
"defrost": options.defrost,
|
884
|
-
"heating1": int(options.heating),
|
885
|
-
},
|
886
|
-
"tempCode": hex_set_temp,
|
887
|
-
"unit": "C",
|
888
|
-
}
|
889
|
-
_LOGGER.debug(f"{DOMAIN} - Start Climate Action Request: {payload}")
|
890
|
-
response = requests.post(
|
891
|
-
url,
|
892
|
-
json=payload,
|
893
|
-
headers=self._get_authenticated_headers(
|
894
|
-
token, vehicle.ccu_ccs2_protocol_support
|
895
|
-
),
|
896
|
-
).json()
|
897
|
-
_LOGGER.debug(f"{DOMAIN} - Start Climate Action Response: {response}")
|
898
|
-
_check_response_for_errors(response)
|
899
|
-
token.device_id = self._get_device_id(self._get_stamp())
|
900
|
-
return response["msgId"]
|
901
|
-
|
902
|
-
def stop_climate(self, token: Token, vehicle: Vehicle) -> str:
|
903
|
-
url = self.SPA_API_URL + "vehicles/" + vehicle.id + "/control/temperature"
|
904
|
-
|
905
|
-
payload = {
|
906
|
-
"action": "stop",
|
907
|
-
"hvacType": 0,
|
908
|
-
"options": {
|
909
|
-
"defrost": True,
|
910
|
-
"heating1": 1,
|
911
|
-
},
|
912
|
-
"tempCode": "10H",
|
913
|
-
"unit": "C",
|
914
|
-
}
|
915
|
-
_LOGGER.debug(f"{DOMAIN} - Stop Climate Action Request: {payload}")
|
916
|
-
response = requests.post(
|
917
|
-
url,
|
918
|
-
json=payload,
|
919
|
-
headers=self._get_authenticated_headers(
|
920
|
-
token, vehicle.ccu_ccs2_protocol_support
|
921
|
-
),
|
922
|
-
).json()
|
923
|
-
_LOGGER.debug(f"{DOMAIN} - Stop Climate Action Response: {response}")
|
924
|
-
_check_response_for_errors(response)
|
925
|
-
token.device_id = self._get_device_id(self._get_stamp())
|
926
|
-
return response["msgId"]
|
927
|
-
|
928
854
|
def start_hazard_lights(self, token: Token, vehicle: Vehicle) -> str:
|
929
855
|
url = self.SPA_API_URL_V2 + "vehicles/" + vehicle.id + "/ccs2/control/light"
|
930
856
|
|
{hyundai_kia_connect_api-3.34.4.dist-info → hyundai_kia_connect_api-3.35.1.dist-info}/METADATA
RENAMED
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: hyundai_kia_connect_api
|
3
|
-
Version: 3.
|
3
|
+
Version: 3.35.1
|
4
4
|
Summary: Python Boilerplate contains all the boilerplate you need to create a Python package.
|
5
5
|
Home-page: https://github.com/Hyundai-Kia-Connect/hyundai_kia_connect_api
|
6
6
|
Author: Fuat Akgun
|
{hyundai_kia_connect_api-3.34.4.dist-info → hyundai_kia_connect_api-3.35.1.dist-info}/RECORD
RENAMED
@@ -1,10 +1,10 @@
|
|
1
1
|
hyundai_kia_connect_api/ApiImpl.py,sha256=UeG2FH4KCdU5LvGp5Ks793vrWbwBx8MN_DedbVRRouM,9612
|
2
|
-
hyundai_kia_connect_api/ApiImplType1.py,sha256=
|
2
|
+
hyundai_kia_connect_api/ApiImplType1.py,sha256=IKtQvaBZLZp9Wfkjqjs8YqMLfX-qmiSWs2IybT_6seU,31478
|
3
3
|
hyundai_kia_connect_api/HyundaiBlueLinkApiUSA.py,sha256=FGYyrS3dSq8Plfu8DQMwVG1LM3nmRv8Y4vrN7wZ4oVY,36988
|
4
|
-
hyundai_kia_connect_api/KiaUvoApiAU.py,sha256=
|
4
|
+
hyundai_kia_connect_api/KiaUvoApiAU.py,sha256=nGR7jwogKrVuM6C6xLNbSDwltuy0PFR11kpGL9YykhY,39922
|
5
5
|
hyundai_kia_connect_api/KiaUvoApiCA.py,sha256=Y2xWIYUuiilk3FXq1ZdHQ0DsFZA_8b6AIT32l595leg,32521
|
6
6
|
hyundai_kia_connect_api/KiaUvoApiCN.py,sha256=WP-rRI3wZmjuLYZmPXeOSk2NNNc6UhTrpOMuYMG6-iE,47043
|
7
|
-
hyundai_kia_connect_api/KiaUvoApiEU.py,sha256=
|
7
|
+
hyundai_kia_connect_api/KiaUvoApiEU.py,sha256=E9bKbwTZ3_b6yL6ud7u_0-lQN4qRQ7nt0CyVD6KmwXM,55041
|
8
8
|
hyundai_kia_connect_api/KiaUvoApiUSA.py,sha256=bOG3ugG_O1g5cL3E_b4F2McXeZYJVzfBpqK_kaYgM9E,30550
|
9
9
|
hyundai_kia_connect_api/Token.py,sha256=ZsPvXh1ID7FUTGHAqhZUZyrKT7xVbOtIn6FRJn4Ygf0,370
|
10
10
|
hyundai_kia_connect_api/Vehicle.py,sha256=hZT0wU7-mMi85bgqNHMu6CyhQQ5h-Jfmoc1ce2uPhYM,18867
|
@@ -14,10 +14,10 @@ hyundai_kia_connect_api/bluelink.py,sha256=JiNIHl-Qi8zwqyN6ywKg5CdXOLT74WkvpjVcn
|
|
14
14
|
hyundai_kia_connect_api/const.py,sha256=gFAhj9-YgrJNd7ZjYr4Qu1Yf4v-RhmyON1MJDN0eR90,2281
|
15
15
|
hyundai_kia_connect_api/exceptions.py,sha256=m7gyDnvA5OVAK4EXSP_ZwE0s0uV8HsGUV0tiYwqofK0,1343
|
16
16
|
hyundai_kia_connect_api/utils.py,sha256=J0aXUX-nKIoS3XbelatNh-DZlHRU2_DYz_Mg_ZUKQJU,1957
|
17
|
-
hyundai_kia_connect_api-3.
|
18
|
-
hyundai_kia_connect_api-3.
|
19
|
-
hyundai_kia_connect_api-3.
|
20
|
-
hyundai_kia_connect_api-3.
|
21
|
-
hyundai_kia_connect_api-3.
|
22
|
-
hyundai_kia_connect_api-3.
|
23
|
-
hyundai_kia_connect_api-3.
|
17
|
+
hyundai_kia_connect_api-3.35.1.dist-info/licenses/AUTHORS.rst,sha256=T77OE1hrQF6YyDE6NbdMKyL66inHt7dnjHAzblwuk2A,155
|
18
|
+
hyundai_kia_connect_api-3.35.1.dist-info/licenses/LICENSE,sha256=49hmc755oyMwKdZ-2epiorjStRB0PfcZR1w5_NXZPgs,1068
|
19
|
+
hyundai_kia_connect_api-3.35.1.dist-info/METADATA,sha256=8tFxM0Yj8hky7u1Q4j8HoCxbmJhmvzPPm4GfUAlmE9M,7142
|
20
|
+
hyundai_kia_connect_api-3.35.1.dist-info/WHEEL,sha256=MAQBAzGbXNI3bUmkDsiV_duv8i-gcdnLzw7cfUFwqhU,109
|
21
|
+
hyundai_kia_connect_api-3.35.1.dist-info/entry_points.txt,sha256=XfrroRdyC_9q9VXjEZe5SdRPhkQyCCE4S7ZK6XSKelA,67
|
22
|
+
hyundai_kia_connect_api-3.35.1.dist-info/top_level.txt,sha256=otZ7J_fN-s3EW4jD-kAearIo2OIzhQLR8DNEHIaFfds,24
|
23
|
+
hyundai_kia_connect_api-3.35.1.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{hyundai_kia_connect_api-3.34.4.dist-info → hyundai_kia_connect_api-3.35.1.dist-info}/top_level.txt
RENAMED
File without changes
|