Skip to content

Commit

Permalink
Check whether camera services are available
Browse files Browse the repository at this point in the history
  • Loading branch information
tschamm committed Oct 3, 2024
1 parent d1ce6e1 commit f25c55f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
21 changes: 14 additions & 7 deletions boschshcpy/models_impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ def min_offset(self) -> float:
def max_offset(self) -> float:
return self._temperatureoffset_service.max_offset


class _SilentMode(SHCDevice):
from .services_impl import (
SilentModeService,
Expand All @@ -202,7 +203,6 @@ def silentmode(self, state: bool):
)



class SHCSmokeDetector(SHCBatteryDevice):
from .services_impl import AlarmService, SmokeDetectorCheckService

Expand Down Expand Up @@ -449,13 +449,15 @@ def privacymode(self, state: bool):

@property
def cameranotification(self) -> CameraNotificationService.State:
return self._cameranotification_service.value
if self._cameranotification_service:
return self._cameranotification_service.value

@cameranotification.setter
def cameranotification(self, state: bool):
self._cameranotification_service.put_state_element(
"value", "ENABLED" if state else "DISABLED"
)
if self._cameranotification_service:
self._cameranotification_service.put_state_element(
"value", "ENABLED" if state else "DISABLED"
)


class SHCCameraEyes(SHCCamera360):
Expand All @@ -469,11 +471,15 @@ def __init__(self, api, raw_device, raw_device_services):

@property
def cameralight(self) -> CameraLightService.State:
return self._cameralight_service.value
if self._cameralight_service:
return self._cameralight_service.value

@cameralight.setter
def cameralight(self, state: bool):
self._cameralight_service.put_state_element("value", "ON" if state else "OFF")
if self._cameralight_service:
self._cameralight_service.put_state_element(
"value", "ON" if state else "OFF"
)


class SHCThermostat(
Expand Down Expand Up @@ -501,6 +507,7 @@ def position(self) -> int:
def valvestate(self) -> ValveTappetService.State:
return self._valvetappet_service.value


class SHCClimateControl(_TemperatureLevel):
from .services_impl import RoomClimateControlService

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

setup(
name="boschshcpy",
version="0.2.92",
version="0.2.93",
url="https://github.com/tschamm/boschshcpy",
author="Clemens-Alexander Brust, Thomas Schamm",
author_email="[email protected], [email protected]",
Expand Down

0 comments on commit f25c55f

Please sign in to comment.