mirror of
https://github.com/python-kasa/python-kasa.git
synced 2025-10-14 19:38:02 +00:00
Implement motion & ambient light sensor modules for dimmers (#278)
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
"""Module for dimmers (currently only HS220)."""
|
||||
from typing import Any, Dict
|
||||
|
||||
from kasa.modules import AmbientLight, Motion
|
||||
from kasa.smartdevice import DeviceType, SmartDeviceException, requires_update
|
||||
from kasa.smartplug import SmartPlug
|
||||
|
||||
@@ -40,6 +41,10 @@ class SmartDimmer(SmartPlug):
|
||||
def __init__(self, host: str) -> None:
|
||||
super().__init__(host)
|
||||
self._device_type = DeviceType.Dimmer
|
||||
# TODO: need to be verified if it's okay to call these on HS220 w/o these
|
||||
# TODO: need to be figured out what's the best approach to detect support for these
|
||||
self.add_module("motion", Motion(self, "smartlife.iot.PIR"))
|
||||
self.add_module("ambient", AmbientLight(self, "smartlife.iot.LAS"))
|
||||
|
||||
@property # type: ignore
|
||||
@requires_update
|
||||
|
Reference in New Issue
Block a user