Skip to content

Commit

Permalink
Merge branch 'master' into CFenner-patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
CFenner authored Nov 19, 2024
2 parents 7c98175 + 3b7103a commit d8be044
Show file tree
Hide file tree
Showing 20 changed files with 3,958 additions and 246 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
- name: 🏗 Build package
run: poetry build --no-interaction
- name: 🚀 Publish to PyPi
uses: pypa/gh-action-pypi-publish@v1.10.3
uses: pypa/gh-action-pypi-publish@v1.12.2
with:
verbose: true
print-hash: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python: ["3.8", "3.9", "3.10", "3.11", "3.12"]
python: ["3.9", "3.10", "3.11", "3.12"]
steps:
- name: ⤵️ Check out code from GitHub
uses: actions/[email protected]
Expand Down
17 changes: 16 additions & 1 deletion PyViCare/PyViCareDevice.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from typing import Any

from PyViCare.PyViCareService import ViCareService
from PyViCare.PyViCareUtils import handleNotSupported
from PyViCare.PyViCareUtils import PyViCareNotSupportedFeatureError, handleNotSupported


class Device:
Expand All @@ -27,3 +27,18 @@ def isLegacyDevice(self) -> bool:

def isE3Device(self) -> bool:
return self.service.hasRoles(["type:E3"])

def isDomesticHotWaterDevice(self):
return self._isTypeDevice("heating.dhw")

def isSolarThermalDevice(self):
return self._isTypeDevice("heating.solar")

def isVentilationDevice(self):
return self._isTypeDevice("ventilation")

def _isTypeDevice(self, deviceType: str):
try:
return self.service.getProperty(deviceType)["isEnabled"] and self.service.getProperty(deviceType)["properties"]["active"]["value"]
except PyViCareNotSupportedFeatureError:
return False
1 change: 1 addition & 0 deletions PyViCare/PyViCareDeviceConfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ def asAutoDetectDevice(self):
(self.asPelletsBoiler, r"Vitoligno|Ecotronic|VBC550P", []),
(self.asElectricalEnergySystem, r"E3_VitoCharge_03", ["type:ees"]),
(self.asVentilation, r"E3_ViAir", ["type:ventilation"]),
(self.asVentilation, r"E3_ViAir", ["type:ventilation;central"]),
(self.asVentilation, r"E3_VitoPure", ["type:ventilation;purifier"]),
(self.asRadiatorActuator, r"E3_RadiatorActuator", ["type:radiator"]),
(self.asRoomSensor, r"E3_RoomSensor", ["type:climateSensor"]),
Expand Down
483 changes: 244 additions & 239 deletions poetry.lock

Large diffs are not rendered by default.

8 changes: 6 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ keywords = [
classifiers = [
"Intended Audience :: Developers",
"Natural Language :: English",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3",
"License :: OSI Approved :: Apache Software License",
"Topic :: Software Development :: Libraries :: Python Modules",
Expand All @@ -38,15 +42,15 @@ Changelog = "https://github.com/openviess/PyViCare/releases"

[tool.poetry.dependencies]
authlib = ">1.2.0"
python = "^3.8"
python = "^3.9"
requests = ">=2.31.0"

[tool.poetry.group.dev.dependencies]
codespell = "^2.3.0"
mypy = "^1.11.2"
pylint = "^3.2.6"
pytest = "^8.3.2"
pytest-cov = "^5.0.0"
pytest-cov = "^6.0.0"
ruff = "^0.7.0"
types-requests = ">=2.31"

Expand Down
Loading

0 comments on commit d8be044

Please sign in to comment.