pyvera 0.3.15__py3-none-any.whl → 0.3.16__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.
pyvera/__init__.py CHANGED
@@ -1227,7 +1227,6 @@ class VeraLock(VeraDevice):
1227
1227
  # Loop to create a list of codes
1228
1228
  codes = []
1229
1229
  for code in raw_code_list:
1230
-
1231
1230
  try:
1232
1231
  # Strip off trailing semicolon
1233
1232
  # Create a list from csv
@@ -1259,17 +1258,17 @@ class VeraThermostat(VeraDevice):
1259
1258
  """Set current goal temperature / setpoint."""
1260
1259
 
1261
1260
  self.set_service_value(
1262
- self.thermostat_setpoint, "CurrentSetpoint", "NewCurrentSetpoint", temp
1261
+ self._thermostat_setpoint, "CurrentSetpoint", "NewCurrentSetpoint", temp
1263
1262
  )
1264
1263
 
1265
- self.set_cache_value("setpoint", temp)
1264
+ self.set_cache_value(self._setpoint_cache_value_name, temp)
1266
1265
 
1267
1266
  def get_current_goal_temperature(self, refresh: bool = False) -> Optional[float]:
1268
1267
  """Get current goal temperature / setpoint."""
1269
1268
  if refresh:
1270
1269
  self.refresh()
1271
1270
  try:
1272
- return float(self.get_value("setpoint"))
1271
+ return float(self.get_value(self._setpoint_cache_value_name))
1273
1272
  except (TypeError, ValueError):
1274
1273
  return None
1275
1274
 
@@ -1344,6 +1343,54 @@ class VeraThermostat(VeraDevice):
1344
1343
  """Set fan to cycle."""
1345
1344
  self.set_fan_mode("PeriodicOn")
1346
1345
 
1346
+ def _has_double_setpoints(self) -> bool:
1347
+ """Determines if a thermostate has two setpoints"""
1348
+ if self.get_value("setpoint"):
1349
+ return False
1350
+
1351
+ if self.get_value("heatsp") and self.get_value("coolsp"):
1352
+ return True
1353
+
1354
+ return False
1355
+
1356
+ def _is_heating_recommended(self) -> bool:
1357
+ mode = self.get_value("mode")
1358
+ state = self.get_value("hvacstate")
1359
+
1360
+ if mode == "HeatOn":
1361
+ return True
1362
+
1363
+ if mode == "CoolOn":
1364
+ return False
1365
+
1366
+ if state == "Heating":
1367
+ return True
1368
+
1369
+ if state == "Cooling":
1370
+ return False
1371
+
1372
+ return True
1373
+
1374
+ @property
1375
+ def _setpoint_cache_value_name(self) -> str:
1376
+ if self._has_double_setpoints():
1377
+ if self._is_heating_recommended():
1378
+ return "heatsp"
1379
+ else:
1380
+ return "coolsp"
1381
+ else:
1382
+ return "setpoint"
1383
+
1384
+ @property
1385
+ def _thermostat_setpoint(self) -> str:
1386
+ if self._has_double_setpoints():
1387
+ if self._is_heating_recommended():
1388
+ return self.thermostat_heat_setpoint
1389
+ else:
1390
+ return self.thermostat_cool_setpoint
1391
+ else:
1392
+ return self.thermostat_setpoint
1393
+
1347
1394
 
1348
1395
  class VeraSceneController(VeraDevice):
1349
1396
  """Class to represent a scene controller."""
@@ -1,25 +1,26 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pyvera
3
- Version: 0.3.15
3
+ Version: 0.3.16
4
4
  Summary: Python API for talking to Veracontrollers
5
- Home-page: https://github.com/pavoni/pyvera
5
+ Home-page: https://github.com/maximvelichko/pyvera
6
6
  License: GPL2
7
7
  Keywords: vera,api
8
8
  Author: James Cole
9
- Requires-Python: >=3.5,<4.0
9
+ Requires-Python: >=3.8,<4.0
10
+ Classifier: License :: OSI Approved :: GNU General Public License v2 (GPLv2)
10
11
  Classifier: License :: Other/Proprietary License
11
12
  Classifier: Programming Language :: Python :: 3
12
- Classifier: Programming Language :: Python :: 3.10
13
- Classifier: Programming Language :: Python :: 3.5
14
- Classifier: Programming Language :: Python :: 3.6
15
- Classifier: Programming Language :: Python :: 3.7
16
13
  Classifier: Programming Language :: Python :: 3.8
17
14
  Classifier: Programming Language :: Python :: 3.9
15
+ Classifier: Programming Language :: Python :: 3.10
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Programming Language :: Python :: 3.13
18
19
  Requires-Dist: requests (>=2.22.0)
19
- Project-URL: Repository, https://github.com/pavoni/pyvera
20
+ Project-URL: Repository, https://github.com/maximvelichko/pyvera
20
21
  Description-Content-Type: text/markdown
21
22
 
22
- # pyVera ![Build status](https://github.com/pavoni/pyvera/workflows/Build/badge.svg) ![PyPi version](https://img.shields.io/pypi/v/pyvera) ![PyPi downloads](https://img.shields.io/pypi/dm/pyvera)
23
+ # pyVera ![Build status](https://github.com/maximvelichko/pyvera/workflows/Build/badge.svg) ![PyPi version](https://img.shields.io/pypi/v/pyvera) ![PyPi downloads](https://img.shields.io/pypi/dm/pyvera)
23
24
 
24
25
  A simple Python library to control devices via the Vera controller (http://getvera.com/).
25
26
 
@@ -0,0 +1,5 @@
1
+ pyvera/__init__.py,sha256=WmSIoDdrx1l4IoBBwWz2JncXKH-kTX-n_vBTbnouKb0,62932
2
+ pyvera-0.3.16.dist-info/LICENSE,sha256=pF0LtXLteS7TRienJiGDSzupKqtuLMTgQwHe56co11M,18027
3
+ pyvera-0.3.16.dist-info/METADATA,sha256=QkjwVaF4mfzqylv2d2qdZmTKHyD_XMjENB5LRdjxYFA,3668
4
+ pyvera-0.3.16.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
5
+ pyvera-0.3.16.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: poetry 1.0.7
2
+ Generator: poetry-core 1.9.1
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
@@ -1,5 +0,0 @@
1
- pyvera/__init__.py,sha256=V8kv1AmgFbHRPUXckofzJ67g_vOn_GrndAr5Q8pDP2Y,61628
2
- pyvera-0.3.15.dist-info/LICENSE,sha256=pF0LtXLteS7TRienJiGDSzupKqtuLMTgQwHe56co11M,18027
3
- pyvera-0.3.15.dist-info/WHEEL,sha256=y3eDiaFVSNTPbgzfNn0nYn5tEn1cX6WrdetDlQM4xWw,83
4
- pyvera-0.3.15.dist-info/METADATA,sha256=8t12p4-lvwK4K5T3_Vzhg-QoZBkEFtb8RJpEILHPt58,3567
5
- pyvera-0.3.15.dist-info/RECORD,,