mirror of
https://github.com/python-kasa/python-kasa.git
synced 2025-10-09 08:58:01 +00:00
Move feature initialization from __init__ to _initialize_features (#1140)
This commit is contained in:
@@ -4,14 +4,11 @@ from __future__ import annotations
|
||||
|
||||
from datetime import datetime, timedelta, timezone
|
||||
from time import mktime
|
||||
from typing import TYPE_CHECKING, cast
|
||||
from typing import cast
|
||||
|
||||
from ...feature import Feature
|
||||
from ..smartmodule import SmartModule
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from ..smartdevice import SmartDevice
|
||||
|
||||
|
||||
class Time(SmartModule):
|
||||
"""Implementation of device_local_time."""
|
||||
@@ -19,12 +16,11 @@ class Time(SmartModule):
|
||||
REQUIRED_COMPONENT = "time"
|
||||
QUERY_GETTER_NAME = "get_device_time"
|
||||
|
||||
def __init__(self, device: SmartDevice, module: str):
|
||||
super().__init__(device, module)
|
||||
|
||||
def _initialize_features(self):
|
||||
"""Initialize features after the initial update."""
|
||||
self._add_feature(
|
||||
Feature(
|
||||
device=device,
|
||||
device=self._device,
|
||||
id="device_time",
|
||||
name="Device time",
|
||||
attribute_getter="time",
|
||||
|
Reference in New Issue
Block a user