mirror of
https://github.com/python-kasa/python-kasa.git
synced 2025-08-06 10:44:04 +00:00
Move feature initialization from __init__ to _initialize_features (#1140)
This commit is contained in:
@@ -16,11 +16,11 @@ from ..iotmodule import IotModule, merge
|
||||
class AmbientLight(IotModule):
|
||||
"""Implements ambient light controls for the motion sensor."""
|
||||
|
||||
def __init__(self, device, module):
|
||||
super().__init__(device, module)
|
||||
def _initialize_features(self):
|
||||
"""Initialize features after the initial update."""
|
||||
self._add_feature(
|
||||
Feature(
|
||||
device=device,
|
||||
device=self._device,
|
||||
container=self,
|
||||
id="ambient_light",
|
||||
name="Ambient Light",
|
||||
|
@@ -24,11 +24,11 @@ class CloudInfo(BaseModel):
|
||||
class Cloud(IotModule):
|
||||
"""Module implementing support for cloud services."""
|
||||
|
||||
def __init__(self, device, module):
|
||||
super().__init__(device, module)
|
||||
def _initialize_features(self):
|
||||
"""Initialize features after the initial update."""
|
||||
self._add_feature(
|
||||
Feature(
|
||||
device=device,
|
||||
device=self._device,
|
||||
container=self,
|
||||
id="cloud_connection",
|
||||
name="Cloud connection",
|
||||
|
Reference in New Issue
Block a user