Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Expose if a device supports dhw, solar thermal or ventilation capabilities #360

Merged
merged 30 commits into from
Nov 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
aa6b8f5
Update PyViCareDevice.py
CFenner Feb 9, 2024
1e19f58
Update PyViCareDevice.py
CFenner Feb 9, 2024
5d543b3
Update test_Solar.py
CFenner Feb 9, 2024
386e995
Update test_VitoairFs300E.py
CFenner Feb 9, 2024
156b42a
Create test_Vitovent.py
CFenner Feb 9, 2024
c4e330d
Create Vitovent.json
CFenner Feb 9, 2024
2118c15
Update test_Vitocal222S.py
CFenner Feb 9, 2024
2b3e411
Update test_Vitodens200W.py
CFenner Feb 9, 2024
8ab5ba7
Update PyViCareDevice.py
CFenner Feb 9, 2024
6b97900
Update test_Vitocal222S.py
CFenner Feb 9, 2024
48acb22
Update test_Solar.py
CFenner Feb 9, 2024
fe50418
update tests
CFenner Apr 3, 2024
abc37a7
Merge branch 'somm15:master' into patch-7
CFenner Apr 3, 2024
ed2eca5
handle exceptions
CFenner Apr 3, 2024
10a0166
ignore pylint issue for now
CFenner Apr 3, 2024
2d28d4f
ignore new properties
CFenner Apr 3, 2024
f57730f
test gateway.devices
CFenner Apr 3, 2024
9fb2b19
test 'heating.solar'
CFenner Apr 3, 2024
61aa75d
check isEnabled and active property
CFenner Apr 3, 2024
a91ac93
add further test cases
CFenner Apr 3, 2024
ea0b704
Merge branch 'master' into patch-7
CFenner Oct 5, 2024
647d576
remove isHeatingDevice
CFenner Oct 5, 2024
1ac00a2
reorder
CFenner Oct 5, 2024
7f33124
change asserts
CFenner Oct 7, 2024
a9f0b96
Merge branch 'master' into patch-7
CFenner Oct 7, 2024
f8799d3
Merge branch 'master' into patch-7
CFenner Nov 11, 2024
ccd24ca
Update and rename Vitovent.json to Vitocal-200S-with-Vitovent-300W.json
CFenner Nov 11, 2024
e86565b
Update and rename test_Vitovent.py to test_vitocal-with-vitovent.py
CFenner Nov 11, 2024
8c0e4f5
sort
CFenner Nov 11, 2024
06a3213
Update test_TestForMissingProperties.py
CFenner Nov 11, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion PyViCare/PyViCareDevice.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from PyViCare.PyViCareService import ViCareService
from PyViCare.PyViCareUtils import handleNotSupported
from PyViCare.PyViCareUtils import PyViCareNotSupportedFeatureError, handleNotSupported


class Device:
Expand All @@ -21,3 +21,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
Loading
Loading