Skip to content

Commit

Permalink
Support opening and closing the cover of MyFoxSecurityCamera (#224)
Browse files Browse the repository at this point in the history
  • Loading branch information
iMicknl authored Aug 13, 2020
1 parent 4e6caa6 commit caf1460
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
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

0 comments on commit caf1460

Please sign in to comment.