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

Support opening and closing the cover of MyFoxSecurityCamera #224

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions custom_components/tahoma/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
"Light": LIGHT,
"LightSensor": SENSOR,
"MotionSensor": BINARY_SENSOR,
"MyFoxSecurityCamera": COVER, # widgetName, uiClass is Camera (not supported)
"OccupancySensor": BINARY_SENSOR,
"OnOff": SWITCH,
"Pergola": COVER,
Expand Down
17 changes: 10 additions & 7 deletions custom_components/tahoma/cover.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
CORE_SLATS_OPEN_CLOSED_STATE = "core:SlatsOpenClosedState"
CORE_SLATS_ORIENTATION_STATE = "core:SlatsOrientationState"
CORE_TARGET_CLOSURE_STATE = "core:TargetClosureState"
MYFOX_SHUTTER_STATUS_STATE = "myfox:ShutterStatusState"

ICON_LOCK_ALERT = "mdi:lock-alert"
ICON_WEATHER_WINDY = "mdi:weather-windy"
Expand All @@ -66,17 +67,18 @@

TAHOMA_COVER_DEVICE_CLASSES = {
"Awning": DEVICE_CLASS_AWNING,
"ExteriorScreen": DEVICE_CLASS_BLIND,
"Pergola": DEVICE_CLASS_AWNING,
"RollerShutter": DEVICE_CLASS_SHUTTER,
"Window": DEVICE_CLASS_WINDOW,
"Blind": DEVICE_CLASS_BLIND,
"GarageDoor": DEVICE_CLASS_GARAGE,
"Curtain": DEVICE_CLASS_CURTAIN,
"ExteriorScreen": DEVICE_CLASS_BLIND,
"ExteriorVenetianBlind": DEVICE_CLASS_BLIND,
"VeluxInteriorBlind": DEVICE_CLASS_BLIND,
"GarageDoor": DEVICE_CLASS_GARAGE,
"Gate": DEVICE_CLASS_GATE,
"Curtain": DEVICE_CLASS_CURTAIN,
"MyFoxSecurityCamera": DEVICE_CLASS_SHUTTER,
"Pergola": DEVICE_CLASS_AWNING,
"RollerShutter": DEVICE_CLASS_SHUTTER,
"SwingingShutter": DEVICE_CLASS_SHUTTER,
"VeluxInteriorBlind": DEVICE_CLASS_BLIND,
"Window": DEVICE_CLASS_WINDOW,
}


Expand Down Expand Up @@ -158,6 +160,7 @@ def is_closed(self):
CORE_OPEN_CLOSED_PARTIAL_STATE,
CORE_OPEN_CLOSED_PEDESTRIAN_STATE,
CORE_OPEN_CLOSED_UNKNOWN_STATE,
MYFOX_SHUTTER_STATUS_STATE,
)

if state is not None:
Expand Down