hyundai-kia-connect-api 3.34.3__py2.py3-none-any.whl → 3.35.0__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 +234 -4
- hyundai_kia_connect_api/KiaUvoApiAU.py +0 -55
- hyundai_kia_connect_api/KiaUvoApiEU.py +1 -190
- {hyundai_kia_connect_api-3.34.3.dist-info → hyundai_kia_connect_api-3.35.0.dist-info}/METADATA +1 -1
- {hyundai_kia_connect_api-3.34.3.dist-info → hyundai_kia_connect_api-3.35.0.dist-info}/RECORD +10 -10
- {hyundai_kia_connect_api-3.34.3.dist-info → hyundai_kia_connect_api-3.35.0.dist-info}/WHEEL +0 -0
- {hyundai_kia_connect_api-3.34.3.dist-info → hyundai_kia_connect_api-3.35.0.dist-info}/entry_points.txt +0 -0
- {hyundai_kia_connect_api-3.34.3.dist-info → hyundai_kia_connect_api-3.35.0.dist-info}/licenses/AUTHORS.rst +0 -0
- {hyundai_kia_connect_api-3.34.3.dist-info → hyundai_kia_connect_api-3.35.0.dist-info}/licenses/LICENSE +0 -0
- {hyundai_kia_connect_api-3.34.3.dist-info → hyundai_kia_connect_api-3.35.0.dist-info}/top_level.txt +0 -0
@@ -10,14 +10,13 @@ from time import sleep
|
|
10
10
|
|
11
11
|
from .ApiImpl import (
|
12
12
|
ApiImpl,
|
13
|
+
ScheduleChargingClimateRequestOptions,
|
14
|
+
ClimateRequestOptions,
|
13
15
|
)
|
14
16
|
from .Token import Token
|
15
17
|
from .Vehicle import Vehicle
|
16
18
|
|
17
|
-
from .utils import
|
18
|
-
get_child_value,
|
19
|
-
parse_datetime,
|
20
|
-
)
|
19
|
+
from .utils import get_child_value, parse_datetime, get_index_into_hex_temp
|
21
20
|
|
22
21
|
from .const import (
|
23
22
|
DOMAIN,
|
@@ -592,3 +591,234 @@ class ApiImplType1(ApiImpl):
|
|
592
591
|
# can't find the action, raise an exception
|
593
592
|
# Old code: raise APIError(f"No action found with ID {action_id}")
|
594
593
|
return ORDER_STATUS.UNKNOWN
|
594
|
+
|
595
|
+
def schedule_charging_and_climate(
|
596
|
+
self,
|
597
|
+
token: Token,
|
598
|
+
vehicle: Vehicle,
|
599
|
+
options: ScheduleChargingClimateRequestOptions,
|
600
|
+
) -> str:
|
601
|
+
url = self.SPA_API_URL_V2 + "vehicles/" + vehicle.id
|
602
|
+
url = url + "/ccs2" # does not depend on vehicle.ccu_ccs2_protocol_support
|
603
|
+
url = url + "/reservation/chargehvac"
|
604
|
+
|
605
|
+
def set_default_departure_options(
|
606
|
+
departure_options: ScheduleChargingClimateRequestOptions.DepartureOptions,
|
607
|
+
) -> None:
|
608
|
+
if departure_options.enabled is None:
|
609
|
+
departure_options.enabled = False
|
610
|
+
if departure_options.days is None:
|
611
|
+
departure_options.days = [0]
|
612
|
+
if departure_options.time is None:
|
613
|
+
departure_options.time = dt.time()
|
614
|
+
|
615
|
+
if options.first_departure is None:
|
616
|
+
options.first_departure = (
|
617
|
+
ScheduleChargingClimateRequestOptions.DepartureOptions()
|
618
|
+
)
|
619
|
+
if options.second_departure is None:
|
620
|
+
options.second_departure = (
|
621
|
+
ScheduleChargingClimateRequestOptions.DepartureOptions()
|
622
|
+
)
|
623
|
+
|
624
|
+
set_default_departure_options(options.first_departure)
|
625
|
+
set_default_departure_options(options.second_departure)
|
626
|
+
departures = [options.first_departure, options.second_departure]
|
627
|
+
|
628
|
+
if options.charging_enabled is None:
|
629
|
+
options.charging_enabled = False
|
630
|
+
if options.off_peak_start_time is None:
|
631
|
+
options.off_peak_start_time = dt.time()
|
632
|
+
if options.off_peak_end_time is None:
|
633
|
+
options.off_peak_end_time = options.off_peak_start_time
|
634
|
+
if options.off_peak_charge_only_enabled is None:
|
635
|
+
options.off_peak_charge_only_enabled = False
|
636
|
+
if options.climate_enabled is None:
|
637
|
+
options.climate_enabled = False
|
638
|
+
if options.temperature is None:
|
639
|
+
options.temperature = 21.0
|
640
|
+
if options.temperature_unit is None:
|
641
|
+
options.temperature_unit = 0
|
642
|
+
if options.defrost is None:
|
643
|
+
options.defrost = False
|
644
|
+
|
645
|
+
temperature: float = options.temperature
|
646
|
+
if options.temperature_unit == 0:
|
647
|
+
# Round to nearest 0.5
|
648
|
+
temperature = round(temperature * 2.0) / 2.0
|
649
|
+
# Cap at 27, floor at 17
|
650
|
+
if temperature > 27.0:
|
651
|
+
temperature = 27.0
|
652
|
+
elif temperature < 17.0:
|
653
|
+
temperature = 17.0
|
654
|
+
|
655
|
+
payload = {
|
656
|
+
"reservChargeInfo" + str(i + 1): {
|
657
|
+
"reservChargeSet": departures[i].enabled,
|
658
|
+
"reservInfo": {
|
659
|
+
"day": departures[i].days,
|
660
|
+
"time": {
|
661
|
+
"time": departures[i].time.strftime("%I%M"),
|
662
|
+
"timeSection": 1 if departures[i].time >= dt.time(12, 0) else 0,
|
663
|
+
},
|
664
|
+
},
|
665
|
+
"reservFatcSet": {
|
666
|
+
"airCtrl": 1 if options.climate_enabled else 0,
|
667
|
+
"airTemp": {
|
668
|
+
"value": f"{temperature:.1f}",
|
669
|
+
"hvacTempType": 1,
|
670
|
+
"unit": options.temperature_unit,
|
671
|
+
},
|
672
|
+
"heating1": 0,
|
673
|
+
"defrost": options.defrost,
|
674
|
+
},
|
675
|
+
}
|
676
|
+
for i in range(2)
|
677
|
+
}
|
678
|
+
|
679
|
+
payload = payload | {
|
680
|
+
"offPeakPowerInfo": {
|
681
|
+
"offPeakPowerTime1": {
|
682
|
+
"endtime": {
|
683
|
+
"timeSection": (
|
684
|
+
1 if options.off_peak_end_time >= dt.time(12, 0) else 0
|
685
|
+
),
|
686
|
+
"time": options.off_peak_end_time.strftime("%I%M"),
|
687
|
+
},
|
688
|
+
"starttime": {
|
689
|
+
"timeSection": (
|
690
|
+
1 if options.off_peak_start_time >= dt.time(12, 0) else 0
|
691
|
+
),
|
692
|
+
"time": options.off_peak_start_time.strftime("%I%M"),
|
693
|
+
},
|
694
|
+
},
|
695
|
+
"offPeakPowerFlag": 2 if options.off_peak_charge_only_enabled else 1,
|
696
|
+
},
|
697
|
+
"reservFlag": 1 if options.charging_enabled else 0,
|
698
|
+
}
|
699
|
+
|
700
|
+
_LOGGER.debug(f"{DOMAIN} - Schedule Charging and Climate Request: {payload}")
|
701
|
+
response = requests.post(
|
702
|
+
url, json=payload, headers=self._get_control_headers(token, vehicle)
|
703
|
+
).json()
|
704
|
+
_LOGGER.debug(f"{DOMAIN} - Schedule Charging and Climate Response: {response}")
|
705
|
+
_check_response_for_errors(response)
|
706
|
+
token.device_id = self._get_device_id(self._get_stamp())
|
707
|
+
return response["msgId"]
|
708
|
+
|
709
|
+
def start_climate(
|
710
|
+
self, token: Token, vehicle: Vehicle, options: ClimateRequestOptions
|
711
|
+
) -> str:
|
712
|
+
url = self.SPA_API_URL + "vehicles/" + vehicle.id + "/control/temperature"
|
713
|
+
|
714
|
+
# Defaults are located here to be region specific
|
715
|
+
|
716
|
+
if options.set_temp is None:
|
717
|
+
options.set_temp = 21
|
718
|
+
if options.duration is None:
|
719
|
+
options.duration = 5
|
720
|
+
if options.defrost is None:
|
721
|
+
options.defrost = False
|
722
|
+
if options.climate is None:
|
723
|
+
options.climate = True
|
724
|
+
if options.heating is None:
|
725
|
+
options.heating = 0
|
726
|
+
if not vehicle.ccu_ccs2_protocol_support:
|
727
|
+
hex_set_temp = get_index_into_hex_temp(
|
728
|
+
self.temperature_range.index(options.set_temp)
|
729
|
+
)
|
730
|
+
|
731
|
+
payload = {
|
732
|
+
"action": "start",
|
733
|
+
"hvacType": 0,
|
734
|
+
"options": {
|
735
|
+
"defrost": options.defrost,
|
736
|
+
"heating1": int(options.heating),
|
737
|
+
},
|
738
|
+
"tempCode": hex_set_temp,
|
739
|
+
"unit": "C",
|
740
|
+
}
|
741
|
+
_LOGGER.debug(f"{DOMAIN} - Start Climate Action Request: {payload}")
|
742
|
+
response = requests.post(
|
743
|
+
url,
|
744
|
+
json=payload,
|
745
|
+
headers=self._get_authenticated_headers(
|
746
|
+
token, vehicle.ccu_ccs2_protocol_support
|
747
|
+
),
|
748
|
+
).json()
|
749
|
+
else:
|
750
|
+
url = (
|
751
|
+
self.SPA_API_URL_V2
|
752
|
+
+ "vehicles/"
|
753
|
+
+ vehicle.id
|
754
|
+
+ "/ccs2/control/temperature"
|
755
|
+
)
|
756
|
+
payload = {
|
757
|
+
"command": "start",
|
758
|
+
"ignitionDuration:": options.duration,
|
759
|
+
"strgWhlHeating": options.steering_wheel,
|
760
|
+
"hvacTempType": 1,
|
761
|
+
"hvacTemp": options.set_temp,
|
762
|
+
"sideRearMirrorHeating": 1,
|
763
|
+
"drvSeatLoc": "R",
|
764
|
+
"seatClimateInfo": {
|
765
|
+
"drvSeatClimateState": options.front_left_seat,
|
766
|
+
"psgSeatClimateState": options.front_right_seat,
|
767
|
+
"rrSeatClimateState": options.rear_right_seat,
|
768
|
+
"rlSeatClimateState": options.rear_left_seat,
|
769
|
+
},
|
770
|
+
"tempUnit": "C",
|
771
|
+
"windshieldFrontDefogState": options.defrost,
|
772
|
+
}
|
773
|
+
_LOGGER.debug(f"{DOMAIN} - Start Climate Action Request: {payload}")
|
774
|
+
response = requests.post(
|
775
|
+
url,
|
776
|
+
json=payload,
|
777
|
+
headers=self._get_control_headers(token, vehicle),
|
778
|
+
).json()
|
779
|
+
_LOGGER.debug(f"{DOMAIN} - Start Climate Action Response: {response}")
|
780
|
+
_check_response_for_errors(response)
|
781
|
+
token.device_id = self._get_device_id(self._get_stamp())
|
782
|
+
return response["msgId"]
|
783
|
+
|
784
|
+
def stop_climate(self, token: Token, vehicle: Vehicle) -> str:
|
785
|
+
if not vehicle.ccu_ccs2_protocol_support:
|
786
|
+
url = self.SPA_API_URL + "vehicles/" + vehicle.id + "/control/temperature"
|
787
|
+
payload = {
|
788
|
+
"action": "stop",
|
789
|
+
"hvacType": 0,
|
790
|
+
"options": {
|
791
|
+
"defrost": True,
|
792
|
+
"heating1": 1,
|
793
|
+
},
|
794
|
+
"tempCode": "10H",
|
795
|
+
"unit": "C",
|
796
|
+
}
|
797
|
+
_LOGGER.debug(f"{DOMAIN} - Stop Climate Action Request: {payload}")
|
798
|
+
response = requests.post(
|
799
|
+
url,
|
800
|
+
json=payload,
|
801
|
+
headers=self._get_authenticated_headers(
|
802
|
+
token, vehicle.ccu_ccs2_protocol_support
|
803
|
+
),
|
804
|
+
).json()
|
805
|
+
else:
|
806
|
+
url = (
|
807
|
+
self.SPA_API_URL_V2
|
808
|
+
+ "vehicles/"
|
809
|
+
+ vehicle.id
|
810
|
+
+ "/ccs2/control/temperature"
|
811
|
+
)
|
812
|
+
payload = {
|
813
|
+
"command": "stop",
|
814
|
+
}
|
815
|
+
_LOGGER.debug(f"{DOMAIN} - Stop Climate Action Request: {payload}")
|
816
|
+
response = requests.post(
|
817
|
+
url,
|
818
|
+
json=payload,
|
819
|
+
headers=self._get_control_headers(token, vehicle),
|
820
|
+
).json()
|
821
|
+
_LOGGER.debug(f"{DOMAIN} - Stop Climate Action Response: {response}")
|
822
|
+
_check_response_for_errors(response)
|
823
|
+
token.device_id = self._get_device_id(self._get_stamp())
|
824
|
+
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,10 +15,7 @@ import requests
|
|
15
15
|
from bs4 import BeautifulSoup
|
16
16
|
from dateutil import tz
|
17
17
|
|
18
|
-
|
19
|
-
ClimateRequestOptions,
|
20
|
-
ScheduleChargingClimateRequestOptions,
|
21
|
-
)
|
18
|
+
|
22
19
|
from .ApiImplType1 import ApiImplType1
|
23
20
|
from .ApiImplType1 import _check_response_for_errors
|
24
21
|
|
@@ -50,7 +47,6 @@ from .exceptions import (
|
|
50
47
|
)
|
51
48
|
from .utils import (
|
52
49
|
get_child_value,
|
53
|
-
get_index_into_hex_temp,
|
54
50
|
get_hex_temp_into_index,
|
55
51
|
parse_datetime,
|
56
52
|
)
|
@@ -855,77 +851,6 @@ class KiaUvoApiEU(ApiImplType1):
|
|
855
851
|
token.device_id = self._get_device_id(self._get_stamp())
|
856
852
|
return response["msgId"]
|
857
853
|
|
858
|
-
def start_climate(
|
859
|
-
self, token: Token, vehicle: Vehicle, options: ClimateRequestOptions
|
860
|
-
) -> str:
|
861
|
-
url = self.SPA_API_URL + "vehicles/" + vehicle.id + "/control/temperature"
|
862
|
-
|
863
|
-
# Defaults are located here to be region specific
|
864
|
-
|
865
|
-
if options.set_temp is None:
|
866
|
-
options.set_temp = 21
|
867
|
-
if options.duration is None:
|
868
|
-
options.duration = 5
|
869
|
-
if options.defrost is None:
|
870
|
-
options.defrost = False
|
871
|
-
if options.climate is None:
|
872
|
-
options.climate = True
|
873
|
-
if options.heating is None:
|
874
|
-
options.heating = 0
|
875
|
-
|
876
|
-
hex_set_temp = get_index_into_hex_temp(
|
877
|
-
self.temperature_range.index(options.set_temp)
|
878
|
-
)
|
879
|
-
|
880
|
-
payload = {
|
881
|
-
"action": "start",
|
882
|
-
"hvacType": 0,
|
883
|
-
"options": {
|
884
|
-
"defrost": options.defrost,
|
885
|
-
"heating1": int(options.heating),
|
886
|
-
},
|
887
|
-
"tempCode": hex_set_temp,
|
888
|
-
"unit": "C",
|
889
|
-
}
|
890
|
-
_LOGGER.debug(f"{DOMAIN} - Start Climate Action Request: {payload}")
|
891
|
-
response = requests.post(
|
892
|
-
url,
|
893
|
-
json=payload,
|
894
|
-
headers=self._get_authenticated_headers(
|
895
|
-
token, vehicle.ccu_ccs2_protocol_support
|
896
|
-
),
|
897
|
-
).json()
|
898
|
-
_LOGGER.debug(f"{DOMAIN} - Start Climate Action Response: {response}")
|
899
|
-
_check_response_for_errors(response)
|
900
|
-
token.device_id = self._get_device_id(self._get_stamp())
|
901
|
-
return response["msgId"]
|
902
|
-
|
903
|
-
def stop_climate(self, token: Token, vehicle: Vehicle) -> str:
|
904
|
-
url = self.SPA_API_URL + "vehicles/" + vehicle.id + "/control/temperature"
|
905
|
-
|
906
|
-
payload = {
|
907
|
-
"action": "stop",
|
908
|
-
"hvacType": 0,
|
909
|
-
"options": {
|
910
|
-
"defrost": True,
|
911
|
-
"heating1": 1,
|
912
|
-
},
|
913
|
-
"tempCode": "10H",
|
914
|
-
"unit": "C",
|
915
|
-
}
|
916
|
-
_LOGGER.debug(f"{DOMAIN} - Stop Climate Action Request: {payload}")
|
917
|
-
response = requests.post(
|
918
|
-
url,
|
919
|
-
json=payload,
|
920
|
-
headers=self._get_authenticated_headers(
|
921
|
-
token, vehicle.ccu_ccs2_protocol_support
|
922
|
-
),
|
923
|
-
).json()
|
924
|
-
_LOGGER.debug(f"{DOMAIN} - Stop Climate Action Response: {response}")
|
925
|
-
_check_response_for_errors(response)
|
926
|
-
token.device_id = self._get_device_id(self._get_stamp())
|
927
|
-
return response["msgId"]
|
928
|
-
|
929
854
|
def start_hazard_lights(self, token: Token, vehicle: Vehicle) -> str:
|
930
855
|
url = self.SPA_API_URL_V2 + "vehicles/" + vehicle.id + "/ccs2/control/light"
|
931
856
|
|
@@ -1167,120 +1092,6 @@ class KiaUvoApiEU(ApiImplType1):
|
|
1167
1092
|
)
|
1168
1093
|
return None
|
1169
1094
|
|
1170
|
-
def schedule_charging_and_climate(
|
1171
|
-
self,
|
1172
|
-
token: Token,
|
1173
|
-
vehicle: Vehicle,
|
1174
|
-
options: ScheduleChargingClimateRequestOptions,
|
1175
|
-
) -> str:
|
1176
|
-
url = self.SPA_API_URL_V2 + "vehicles/" + vehicle.id
|
1177
|
-
url = url + "/ccs2" # does not depend on vehicle.ccu_ccs2_protocol_support
|
1178
|
-
url = url + "/reservation/chargehvac"
|
1179
|
-
|
1180
|
-
def set_default_departure_options(
|
1181
|
-
departure_options: ScheduleChargingClimateRequestOptions.DepartureOptions,
|
1182
|
-
) -> None:
|
1183
|
-
if departure_options.enabled is None:
|
1184
|
-
departure_options.enabled = False
|
1185
|
-
if departure_options.days is None:
|
1186
|
-
departure_options.days = [0]
|
1187
|
-
if departure_options.time is None:
|
1188
|
-
departure_options.time = dt.time()
|
1189
|
-
|
1190
|
-
if options.first_departure is None:
|
1191
|
-
options.first_departure = (
|
1192
|
-
ScheduleChargingClimateRequestOptions.DepartureOptions()
|
1193
|
-
)
|
1194
|
-
if options.second_departure is None:
|
1195
|
-
options.second_departure = (
|
1196
|
-
ScheduleChargingClimateRequestOptions.DepartureOptions()
|
1197
|
-
)
|
1198
|
-
|
1199
|
-
set_default_departure_options(options.first_departure)
|
1200
|
-
set_default_departure_options(options.second_departure)
|
1201
|
-
departures = [options.first_departure, options.second_departure]
|
1202
|
-
|
1203
|
-
if options.charging_enabled is None:
|
1204
|
-
options.charging_enabled = False
|
1205
|
-
if options.off_peak_start_time is None:
|
1206
|
-
options.off_peak_start_time = dt.time()
|
1207
|
-
if options.off_peak_end_time is None:
|
1208
|
-
options.off_peak_end_time = options.off_peak_start_time
|
1209
|
-
if options.off_peak_charge_only_enabled is None:
|
1210
|
-
options.off_peak_charge_only_enabled = False
|
1211
|
-
if options.climate_enabled is None:
|
1212
|
-
options.climate_enabled = False
|
1213
|
-
if options.temperature is None:
|
1214
|
-
options.temperature = 21.0
|
1215
|
-
if options.temperature_unit is None:
|
1216
|
-
options.temperature_unit = 0
|
1217
|
-
if options.defrost is None:
|
1218
|
-
options.defrost = False
|
1219
|
-
|
1220
|
-
temperature: float = options.temperature
|
1221
|
-
if options.temperature_unit == 0:
|
1222
|
-
# Round to nearest 0.5
|
1223
|
-
temperature = round(temperature * 2.0) / 2.0
|
1224
|
-
# Cap at 27, floor at 17
|
1225
|
-
if temperature > 27.0:
|
1226
|
-
temperature = 27.0
|
1227
|
-
elif temperature < 17.0:
|
1228
|
-
temperature = 17.0
|
1229
|
-
|
1230
|
-
payload = {
|
1231
|
-
"reservChargeInfo" + str(i + 1): {
|
1232
|
-
"reservChargeSet": departures[i].enabled,
|
1233
|
-
"reservInfo": {
|
1234
|
-
"day": departures[i].days,
|
1235
|
-
"time": {
|
1236
|
-
"time": departures[i].time.strftime("%I%M"),
|
1237
|
-
"timeSection": 1 if departures[i].time >= dt.time(12, 0) else 0,
|
1238
|
-
},
|
1239
|
-
},
|
1240
|
-
"reservFatcSet": {
|
1241
|
-
"airCtrl": 1 if options.climate_enabled else 0,
|
1242
|
-
"airTemp": {
|
1243
|
-
"value": f"{temperature:.1f}",
|
1244
|
-
"hvacTempType": 1,
|
1245
|
-
"unit": options.temperature_unit,
|
1246
|
-
},
|
1247
|
-
"heating1": 0,
|
1248
|
-
"defrost": options.defrost,
|
1249
|
-
},
|
1250
|
-
}
|
1251
|
-
for i in range(2)
|
1252
|
-
}
|
1253
|
-
|
1254
|
-
payload = payload | {
|
1255
|
-
"offPeakPowerInfo": {
|
1256
|
-
"offPeakPowerTime1": {
|
1257
|
-
"endtime": {
|
1258
|
-
"timeSection": (
|
1259
|
-
1 if options.off_peak_end_time >= dt.time(12, 0) else 0
|
1260
|
-
),
|
1261
|
-
"time": options.off_peak_end_time.strftime("%I%M"),
|
1262
|
-
},
|
1263
|
-
"starttime": {
|
1264
|
-
"timeSection": (
|
1265
|
-
1 if options.off_peak_start_time >= dt.time(12, 0) else 0
|
1266
|
-
),
|
1267
|
-
"time": options.off_peak_start_time.strftime("%I%M"),
|
1268
|
-
},
|
1269
|
-
},
|
1270
|
-
"offPeakPowerFlag": 2 if options.off_peak_charge_only_enabled else 1,
|
1271
|
-
},
|
1272
|
-
"reservFlag": 1 if options.charging_enabled else 0,
|
1273
|
-
}
|
1274
|
-
|
1275
|
-
_LOGGER.debug(f"{DOMAIN} - Schedule Charging and Climate Request: {payload}")
|
1276
|
-
response = requests.post(
|
1277
|
-
url, json=payload, headers=self._get_control_headers(token, vehicle)
|
1278
|
-
).json()
|
1279
|
-
_LOGGER.debug(f"{DOMAIN} - Schedule Charging and Climate Response: {response}")
|
1280
|
-
_check_response_for_errors(response)
|
1281
|
-
token.device_id = self._get_device_id(self._get_stamp())
|
1282
|
-
return response["msgId"]
|
1283
|
-
|
1284
1095
|
def valet_mode_action(
|
1285
1096
|
self, token: Token, vehicle: Vehicle, action: VALET_MODE_ACTION
|
1286
1097
|
) -> str:
|
{hyundai_kia_connect_api-3.34.3.dist-info → hyundai_kia_connect_api-3.35.0.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.0
|
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.3.dist-info → hyundai_kia_connect_api-3.35.0.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=m0jTV0bumUnqfCSQln5FCquNeAzi9_81go4piKXSa3U,31410
|
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.0.dist-info/licenses/AUTHORS.rst,sha256=T77OE1hrQF6YyDE6NbdMKyL66inHt7dnjHAzblwuk2A,155
|
18
|
+
hyundai_kia_connect_api-3.35.0.dist-info/licenses/LICENSE,sha256=49hmc755oyMwKdZ-2epiorjStRB0PfcZR1w5_NXZPgs,1068
|
19
|
+
hyundai_kia_connect_api-3.35.0.dist-info/METADATA,sha256=3zYMgjonPboC8N7ZvQMhkbySM8pCgd9j44zDfxYti4s,7142
|
20
|
+
hyundai_kia_connect_api-3.35.0.dist-info/WHEEL,sha256=MAQBAzGbXNI3bUmkDsiV_duv8i-gcdnLzw7cfUFwqhU,109
|
21
|
+
hyundai_kia_connect_api-3.35.0.dist-info/entry_points.txt,sha256=XfrroRdyC_9q9VXjEZe5SdRPhkQyCCE4S7ZK6XSKelA,67
|
22
|
+
hyundai_kia_connect_api-3.35.0.dist-info/top_level.txt,sha256=otZ7J_fN-s3EW4jD-kAearIo2OIzhQLR8DNEHIaFfds,24
|
23
|
+
hyundai_kia_connect_api-3.35.0.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{hyundai_kia_connect_api-3.34.3.dist-info → hyundai_kia_connect_api-3.35.0.dist-info}/top_level.txt
RENAMED
File without changes
|