pyvera 0.3.15__tar.gz → 0.3.16__tar.gz
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.
@@ -1,25 +1,26 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: pyvera
|
3
|
-
Version: 0.3.
|
3
|
+
Version: 0.3.16
|
4
4
|
Summary: Python API for talking to Veracontrollers
|
5
|
-
Home-page: https://github.com/
|
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.
|
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/
|
20
|
+
Project-URL: Repository, https://github.com/maximvelichko/pyvera
|
20
21
|
Description-Content-Type: text/markdown
|
21
22
|
|
22
|
-
# pyVera   
|
23
24
|
|
24
25
|
A simple Python library to control devices via the Vera controller (http://getvera.com/).
|
25
26
|
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# pyVera   
|
2
2
|
|
3
3
|
A simple Python library to control devices via the Vera controller (http://getvera.com/).
|
4
4
|
|
@@ -1,19 +1,23 @@
|
|
1
1
|
[tool.poetry]
|
2
2
|
name = "pyvera"
|
3
|
-
version = "0.3.
|
3
|
+
version = "0.3.16"
|
4
4
|
description = "Python API for talking to Veracontrollers"
|
5
5
|
|
6
6
|
license = "GPL2"
|
7
7
|
|
8
8
|
authors = [
|
9
9
|
"James Cole",
|
10
|
-
"Greg Dowling <mail@gregdowling.com>"
|
10
|
+
"Greg Dowling <mail@gregdowling.com>",
|
11
|
+
"Max Velitchko"
|
12
|
+
]
|
13
|
+
classifiers = [
|
14
|
+
"License :: OSI Approved :: GNU General Public License v2 (GPLv2)",
|
11
15
|
]
|
12
16
|
|
13
17
|
readme = 'README.md'
|
14
18
|
|
15
|
-
repository = "https://github.com/
|
16
|
-
homepage = "https://github.com/
|
19
|
+
repository = "https://github.com/maximvelichko/pyvera"
|
20
|
+
homepage = "https://github.com/maximvelichko/pyvera"
|
17
21
|
|
18
22
|
keywords = ['vera', 'api']
|
19
23
|
|
@@ -22,22 +26,22 @@ requires = ["poetry-core>=1.0.0"]
|
|
22
26
|
build-backend = "poetry.core.masonry.api"
|
23
27
|
|
24
28
|
[tool.poetry.dependencies]
|
25
|
-
python = "
|
29
|
+
python = ">=3.8,<4.0"
|
26
30
|
requests = ">=2.22.0"
|
27
31
|
|
28
32
|
[tool.poetry.dev-dependencies]
|
29
|
-
black = {version = "==
|
30
|
-
coverage = "==
|
33
|
+
black = {version = "==23.10.1", python = "^3.7"}
|
34
|
+
coverage = "==7.3.2"
|
31
35
|
flake8 = "==3.7.8"
|
32
36
|
isort = "==4.3.21"
|
33
|
-
mypy = "==
|
37
|
+
mypy = "==1.6.1"
|
34
38
|
pydocstyle = "==4.0.1"
|
35
|
-
pylint = "==
|
36
|
-
pytest = "==
|
37
|
-
pytest-cov = "==
|
39
|
+
pylint = "==3.0.2"
|
40
|
+
pytest = "==7.4.2"
|
41
|
+
pytest-cov = "==4.1.0"
|
38
42
|
responses = "==0.10.6"
|
39
43
|
toml = "==0.10.0" # Needed by isort and others.
|
40
|
-
wheel = "==0.
|
44
|
+
wheel = "==0.38.1" # Needed for successful compile of other modules.
|
41
45
|
|
42
46
|
[tool.black]
|
43
47
|
target-version = ["py35", "py36", "py37", "py38"]
|
@@ -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.
|
1261
|
+
self._thermostat_setpoint, "CurrentSetpoint", "NewCurrentSetpoint", temp
|
1263
1262
|
)
|
1264
1263
|
|
1265
|
-
self.set_cache_value(
|
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(
|
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."""
|
pyvera-0.3.15/setup.py
DELETED
@@ -1,30 +0,0 @@
|
|
1
|
-
# -*- coding: utf-8 -*-
|
2
|
-
from setuptools import setup
|
3
|
-
|
4
|
-
packages = \
|
5
|
-
['pyvera']
|
6
|
-
|
7
|
-
package_data = \
|
8
|
-
{'': ['*']}
|
9
|
-
|
10
|
-
install_requires = \
|
11
|
-
['requests>=2.22.0']
|
12
|
-
|
13
|
-
setup_kwargs = {
|
14
|
-
'name': 'pyvera',
|
15
|
-
'version': '0.3.15',
|
16
|
-
'description': 'Python API for talking to Veracontrollers',
|
17
|
-
'long_description': '# pyVera   \n\nA simple Python library to control devices via the Vera controller (http://getvera.com/).\n\nBased on https://github.com/jamespcole/home-assistant-vera-api\n\nAdditions to support subscriptions and some additional devices\n\nHow to use\n----------\n\n\n >>> import pyvera\n\n >>> controller = pyvera.VeraController("http://192.168.1.161:3480/")\n >>> devices = controller.get_devices(\'On/Off Switch\')\n >>> devices\n [VeraSwitch (id=15 category=On/Off Switch name=Bookcase Uplighters), VeraSwitch (id=16 category=On/Off Switch name=Bookcase device)]\n\n >>> devices[1]\n VeraSwitch (id=15 category=On/Off Switch name=Bookcase Uplighters)\n\n >>> devices[1].is_switched_on()\n False\n\n >>> devices[1].switch_on()\n >>> devices[1].is_switched_on()\n True\n\n >>> devices[1].switch_off()\n\n\nExamples\n-------\n\nThere is some example code (that can also help with tracing and debugging) in the `examples` directory.\n\nThis will list your vera devices\n~~~~\n$ ./examples/list_devices.py -u http://192.168.1.161:3480\n~~~~\n\nThis will show you events on a particular device (get the id from the example above)\n~~~~\n$ ./examples/device_listener.py -u http://192.168.1.161:3480/ -i 26\n~~~~\n\nIf you have locks - this will show you information about them.\n~~~~\n$ ./examples/show_lock_info.py -u http://192.168.1.161:3480/\n~~~~\n\nView existing locks and PINs:\n~~~~\n$ ./examples/show_lock_info.py -u http://192.168.1.161:3480/\n~~~~\n\nSet a new door lock code on device 335:\n~~~~\n$ ./examples/set_door_code.py -u http://192.168.1.161:3480/ -i 335 -n "John Doe" -p "5678"\n~~~~\n\nClear a existing door lock code from device 335:\n~~~~\n$ ./examples/delete_door_code.py -u http://192.168.1.161:3480/ -i 335 -n "John Doe"\n~~~~\n\nDebugging\n-------\nYou may use the PYVERA_LOGLEVEL environment variable to output more verbose messages to the console. For instance, to show all debug level messages using the list-devices implementation in the example directory, run something similar to:\n~~~~\n$ PYVERA_LOGLEVEL=DEBUG ./examples/list-devices.py -u http://192.168.1.161:3480\n~~~~\n\nDebugging inside home assistant\n-------\nIf you\'re running pyvera inside home assistant and need the debugging log traces, add the following to your `configuration.yaml`\n\n\n~~~~\nlogger:\n logs:\n pyvera: debug\n~~~~\n\nDeveloping\n-------\nSetup and builds are fully automated. You can run build pipeline locally by running.\n~~~~\n# Setup, build, lint and test the code.\n./scripts/build.sh\n~~~~\n\nLicense\n-------\nThe initial code was initially was written by James Cole and released under the BSD license. The rest is released under the MIT license.\n\n',
|
18
|
-
'author': 'James Cole',
|
19
|
-
'author_email': None,
|
20
|
-
'maintainer': None,
|
21
|
-
'maintainer_email': None,
|
22
|
-
'url': 'https://github.com/pavoni/pyvera',
|
23
|
-
'packages': packages,
|
24
|
-
'package_data': package_data,
|
25
|
-
'install_requires': install_requires,
|
26
|
-
'python_requires': '>=3.5,<4.0',
|
27
|
-
}
|
28
|
-
|
29
|
-
|
30
|
-
setup(**setup_kwargs)
|
File without changes
|