pycupra 0.0.3__py3-none-any.whl → 0.0.4__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.
pycupra/__version__.py CHANGED
@@ -3,4 +3,4 @@ pycupra - A Python 3 library for interacting with the My Cupra/My Seat portal.
3
3
 
4
4
  For more details and documentation, visit the github page at https://github.com/WulfgarW/pycupra
5
5
  """
6
- __version__ = "0.0.3"
6
+ __version__ = "0.0.4"
pycupra/connection.py CHANGED
@@ -153,6 +153,7 @@ class Connection:
153
153
  if os.path.isfile(self._tokenFile):
154
154
  with open(self._tokenFile, "r") as f:
155
155
  tokenString=f.read()
156
+ f.close()
156
157
  tokens=json.loads(tokenString)
157
158
  self._session_tokens[brand]=tokens
158
159
  self._user_id=tokens['user_id']
@@ -171,6 +172,7 @@ class Connection:
171
172
  try:
172
173
  with open(self._tokenFile, "w") as f:
173
174
  f.write(json.dumps(self._session_tokens[brand]))
175
+ f.close()
174
176
  return True
175
177
  except Exception as e:
176
178
  _LOGGER.warning(f'writeTokenFile() not successful. Error: {e}')
@@ -193,6 +195,7 @@ class Connection:
193
195
  with open(f'./www/image_{imageName}.png', "wb") as f:
194
196
  f.write(imageData)
195
197
  imageDict[imageName]=f'/local/image_{imageName}.png'
198
+ f.close()
196
199
  return True
197
200
  except:
198
201
  _LOGGER.warning('writeImageFile() not successful. Ignoring this problem.')
pycupra/dashboard.py CHANGED
@@ -711,8 +711,8 @@ class DepartureTimer1(Switch):
711
711
 
712
712
  @property
713
713
  def state(self):
714
- status = self.vehicle.departure1.get("timerProgrammedStatus", "")
715
- if status == "programmed":
714
+ status = self.vehicle.departure1.get("enabled", "")
715
+ if status:
716
716
  return True
717
717
  else:
718
718
  return False
@@ -743,8 +743,8 @@ class DepartureTimer2(Switch):
743
743
 
744
744
  @property
745
745
  def state(self):
746
- status = self.vehicle.departure2.get("timerProgrammedStatus", "")
747
- if status == "programmed":
746
+ status = self.vehicle.departure2.get("enabled", "")
747
+ if status:
748
748
  return True
749
749
  else:
750
750
  return False
@@ -774,8 +774,8 @@ class DepartureTimer3(Switch):
774
774
 
775
775
  @property
776
776
  def state(self):
777
- status = self.vehicle.departure3.get("timerProgrammedStatus", "")
778
- if status == "programmed":
777
+ status = self.vehicle.departure3.get("enabled", "")
778
+ if status:
779
779
  return True
780
780
  else:
781
781
  return False
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pycupra
3
- Version: 0.0.3
3
+ Version: 0.0.4
4
4
  Summary: A library to read and send vehicle data via Cupra/Seat portal using the same API calls as the MyCupra/MySeat mobile app.
5
5
  Home-page: https://github.com/WulfgarW/pycupra
6
6
  Author: WulfgarW
@@ -0,0 +1,13 @@
1
+ pycupra/__init__.py,sha256=VPzUfKd5mBFD1UERNV61FbGHih5dQPupLgIfYtmIUi4,230
2
+ pycupra/__version__.py,sha256=Jg8rvIbOVp1FjzVg0HGzifRrq1AIQh-Wng2duMF9Rns,207
3
+ pycupra/connection.py,sha256=8kh14krvWZZfALo-waL61Cox79XhfII1GS49Ni-UgqM,76334
4
+ pycupra/const.py,sha256=Mx9pPZifQBpn9lTsLH8R7xkUHrXRvul8w_b6LLLD7gE,10038
5
+ pycupra/dashboard.py,sha256=7sVQI10lMspAOfVOlMEvMlndiNlUxjpWoNobUU9CZrw,37636
6
+ pycupra/exceptions.py,sha256=Nq_F79GP8wjHf5lpvPy9TbSIrRHAJrFMo0T1N9TcgSQ,2917
7
+ pycupra/utilities.py,sha256=cH4MiIzT2WlHgmnl_E7rR0R5LvCXfDNvirJolct50V8,2563
8
+ pycupra/vehicle.py,sha256=v9U_cBQGXwa8dsmqyfQZm2WGOZ9uKqWW7FoiO4JsAw0,108436
9
+ pycupra-0.0.4.dist-info/licenses/LICENSE,sha256=HrhfyXIkWY2tGFK11kg7vPCqhgh5DcxleloqdhrpyMY,11558
10
+ pycupra-0.0.4.dist-info/METADATA,sha256=_YcaDFZEuFj_eJdtsfqg2CW87-dnOKnJbPZQfGASk1E,2578
11
+ pycupra-0.0.4.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
12
+ pycupra-0.0.4.dist-info/top_level.txt,sha256=9Lbj_jG4JvpGwt6K3AwhWFc0XieDnuHFOP4x44wSXSQ,8
13
+ pycupra-0.0.4.dist-info/RECORD,,
@@ -1,13 +0,0 @@
1
- pycupra/__init__.py,sha256=VPzUfKd5mBFD1UERNV61FbGHih5dQPupLgIfYtmIUi4,230
2
- pycupra/__version__.py,sha256=vOTajmv3IRptr-g9nG6y6xUN06JYKI_30Dty1N88ekk,207
3
- pycupra/connection.py,sha256=9EXvTbBZJTcCAef5mYuvldAxBcNnxxxCdPZfi2_TtdM,76264
4
- pycupra/const.py,sha256=Mx9pPZifQBpn9lTsLH8R7xkUHrXRvul8w_b6LLLD7gE,10038
5
- pycupra/dashboard.py,sha256=a62F3Zsw2UyBUjYFOrhnqdSk2o2cSkSvmj67FwO8taw,37726
6
- pycupra/exceptions.py,sha256=Nq_F79GP8wjHf5lpvPy9TbSIrRHAJrFMo0T1N9TcgSQ,2917
7
- pycupra/utilities.py,sha256=cH4MiIzT2WlHgmnl_E7rR0R5LvCXfDNvirJolct50V8,2563
8
- pycupra/vehicle.py,sha256=v9U_cBQGXwa8dsmqyfQZm2WGOZ9uKqWW7FoiO4JsAw0,108436
9
- pycupra-0.0.3.dist-info/licenses/LICENSE,sha256=HrhfyXIkWY2tGFK11kg7vPCqhgh5DcxleloqdhrpyMY,11558
10
- pycupra-0.0.3.dist-info/METADATA,sha256=scTdNoBQznv8WlxbYmU0MDLOEpYkyp_j9EFaeLr8tkM,2578
11
- pycupra-0.0.3.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
12
- pycupra-0.0.3.dist-info/top_level.txt,sha256=9Lbj_jG4JvpGwt6K3AwhWFc0XieDnuHFOP4x44wSXSQ,8
13
- pycupra-0.0.3.dist-info/RECORD,,