hyundai-kia-connect-api 3.18.0__py2.py3-none-any.whl → 3.19.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.
@@ -44,8 +44,9 @@ class ApiImplType1(ApiImpl):
44
44
 
45
45
  def _update_vehicle_properties_ccs2(self, vehicle: Vehicle, state: dict) -> None:
46
46
  if get_child_value(state, "Date"):
47
+ # `Date` field is in UTC time
47
48
  vehicle.last_updated_at = parse_datetime(
48
- get_child_value(state, "Date"), self.data_timezone
49
+ get_child_value(state, "Date"), dt.timezone.utc
49
50
  )
50
51
  else:
51
52
  vehicle.last_updated_at = dt.datetime.now(self.data_timezone)
@@ -636,7 +636,65 @@ class HyundaiBlueLinkAPIUSA(ApiImpl):
636
636
  _LOGGER.debug(f"{DOMAIN} - Stop engine response: {response.text}")
637
637
 
638
638
  def start_charge(self, token: Token, vehicle: Vehicle) -> None:
639
- pass
639
+ if vehicle.engine_type != ENGINE_TYPES.EV:
640
+ return {}
641
+
642
+ _LOGGER.debug(f"{DOMAIN} - Start charging..")
643
+
644
+ url = self.API_URL + "evc/charge/start"
645
+ headers = self._get_vehicle_headers(token, vehicle)
646
+ _LOGGER.debug(f"{DOMAIN} - Start charging headers: {headers}")
647
+
648
+ response = self.sessions.post(url, headers=headers)
649
+ _LOGGER.debug(
650
+ f"{DOMAIN} - Start charge response status code: {response.status_code}"
651
+ )
652
+ _LOGGER.debug(f"{DOMAIN} - Start charge response: {response.text}")
640
653
 
641
654
  def stop_charge(self, token: Token, vehicle: Vehicle) -> None:
642
- pass
655
+ if vehicle.engine_type != ENGINE_TYPES.EV:
656
+ return {}
657
+
658
+ _LOGGER.debug(f"{DOMAIN} - Stop charging..")
659
+
660
+ url = self.API_URL + "evc/charge/stop"
661
+ headers = self._get_vehicle_headers(token, vehicle)
662
+ _LOGGER.debug(f"{DOMAIN} - Stop charging headers: {headers}")
663
+
664
+ response = self.sessions.post(url, headers=headers)
665
+ _LOGGER.debug(
666
+ f"{DOMAIN} - Stop charge response status code: {response.status_code}"
667
+ )
668
+ _LOGGER.debug(f"{DOMAIN} - Stop charge response: {response.text}")
669
+
670
+ def set_charge_limits(
671
+ self, token: Token, vehicle: Vehicle, ac: int, dc: int
672
+ ) -> str:
673
+ if vehicle.engine_type != ENGINE_TYPES.EV:
674
+ return {}
675
+
676
+ _LOGGER.debug(f"{DOMAIN} - Setting charge limits..")
677
+ url = self.API_URL + "evc/charge/targetsoc/set"
678
+ headers = self._get_vehicle_headers(token, vehicle)
679
+ _LOGGER.debug(f"{DOMAIN} - Setting charge limits: {headers}")
680
+
681
+ data = {
682
+ "targetSOClist": [
683
+ {
684
+ "plugType": 0,
685
+ "targetSOClevel": int(dc),
686
+ },
687
+ {
688
+ "plugType": 1,
689
+ "targetSOClevel": int(ac),
690
+ },
691
+ ]
692
+ }
693
+
694
+ _LOGGER.debug(f"{DOMAIN} - Setting charge limits body: {data}")
695
+
696
+ response = self.sessions.post(url, json=data, headers=headers)
697
+ _LOGGER.debug(
698
+ f"{DOMAIN} - Setting charge limits response status code: {response.status_code}"
699
+ )
700
+ _LOGGER.debug(f"{DOMAIN} - Setting charge limits: {response.text}")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: hyundai_kia_connect_api
3
- Version: 3.18.0
3
+ Version: 3.19.1
4
4
  Summary: Python Boilerplate contains all the boilerplate you need to create a Python package.
5
5
  Home-page: https://github.com/fuatakgun/hyundai_kia_connect_api
6
6
  Author: Fuat Akgun
@@ -1,6 +1,6 @@
1
1
  hyundai_kia_connect_api/ApiImpl.py,sha256=rH2nePqBaH8_aBWqnBKR4lM-fdrhW9c1brqsBWW9xDc,5057
2
- hyundai_kia_connect_api/ApiImplType1.py,sha256=bKvU2IMdr-rT9CCEljM3Qk1c_vKaSMQxSPMeISZq8JQ,11998
3
- hyundai_kia_connect_api/HyundaiBlueLinkAPIUSA.py,sha256=n6d14uP0TV4OxoSShE69KtxvxN1qoXztWQLtKjI4g30,25889
2
+ hyundai_kia_connect_api/ApiImplType1.py,sha256=pCFDFF1nN9eRun5zT462af5Xxu-Q0zYAUUStcoy5DJI,12037
3
+ hyundai_kia_connect_api/HyundaiBlueLinkAPIUSA.py,sha256=wFdn-IzrJ4V3jwoPeysV72wlx7Rnnxu4kRkjXEY77Q0,28066
4
4
  hyundai_kia_connect_api/KiaUvoAPIUSA.py,sha256=TnypwnLUIdQxc2ksMT05om2RtWHNYpI2agCNm0owV60,30546
5
5
  hyundai_kia_connect_api/KiaUvoApiAU.py,sha256=FeK502Zysgcg3Yx31mjTh4rivFRuGB2sS07TldBzchk,48014
6
6
  hyundai_kia_connect_api/KiaUvoApiCA.py,sha256=4gglRrGj6y4cw0ekRx0ELhIjfkPlbjmJyKUZwQbUFpU,29681
@@ -13,9 +13,9 @@ hyundai_kia_connect_api/__init__.py,sha256=nqODLee6fwh8EwA6gzRrTN8hQP1SBFqfYRmvM
13
13
  hyundai_kia_connect_api/const.py,sha256=ofi_ZfGxJYo0FWIcGFbIMSMRdKRtaK4GUDhFiQRvZeI,2007
14
14
  hyundai_kia_connect_api/exceptions.py,sha256=m7gyDnvA5OVAK4EXSP_ZwE0s0uV8HsGUV0tiYwqofK0,1343
15
15
  hyundai_kia_connect_api/utils.py,sha256=54O8Y9Xma0SqeK2c_mqX4AJGJXQWma7POZJizFPPlvo,1711
16
- hyundai_kia_connect_api-3.18.0.dist-info/AUTHORS.rst,sha256=T77OE1hrQF6YyDE6NbdMKyL66inHt7dnjHAzblwuk2A,155
17
- hyundai_kia_connect_api-3.18.0.dist-info/LICENSE,sha256=49hmc755oyMwKdZ-2epiorjStRB0PfcZR1w5_NXZPgs,1068
18
- hyundai_kia_connect_api-3.18.0.dist-info/METADATA,sha256=PqNOfhiNl4ePJsy4iRugbLqFq7a4GJjVbi3GDZwr0t8,6010
19
- hyundai_kia_connect_api-3.18.0.dist-info/WHEEL,sha256=DZajD4pwLWue70CAfc7YaxT1wLUciNBvN_TTcvXpltE,110
20
- hyundai_kia_connect_api-3.18.0.dist-info/top_level.txt,sha256=otZ7J_fN-s3EW4jD-kAearIo2OIzhQLR8DNEHIaFfds,24
21
- hyundai_kia_connect_api-3.18.0.dist-info/RECORD,,
16
+ hyundai_kia_connect_api-3.19.1.dist-info/AUTHORS.rst,sha256=T77OE1hrQF6YyDE6NbdMKyL66inHt7dnjHAzblwuk2A,155
17
+ hyundai_kia_connect_api-3.19.1.dist-info/LICENSE,sha256=49hmc755oyMwKdZ-2epiorjStRB0PfcZR1w5_NXZPgs,1068
18
+ hyundai_kia_connect_api-3.19.1.dist-info/METADATA,sha256=QFx3zqEOTLIKGQRJRps4py6VEsLSSF4zHQdEXFFFLUs,6010
19
+ hyundai_kia_connect_api-3.19.1.dist-info/WHEEL,sha256=DZajD4pwLWue70CAfc7YaxT1wLUciNBvN_TTcvXpltE,110
20
+ hyundai_kia_connect_api-3.19.1.dist-info/top_level.txt,sha256=otZ7J_fN-s3EW4jD-kAearIo2OIzhQLR8DNEHIaFfds,24
21
+ hyundai_kia_connect_api-3.19.1.dist-info/RECORD,,