mirror of
https://github.com/python-kasa/python-kasa.git
synced 2024-12-23 11:43:34 +00:00
27 lines
585 B
Python
27 lines
585 B
Python
|
"""Module for time interface."""
|
||
|
|
||
|
from __future__ import annotations
|
||
|
|
||
|
from abc import ABC, abstractmethod
|
||
|
from datetime import datetime, tzinfo
|
||
|
|
||
|
from ..module import Module
|
||
|
|
||
|
|
||
|
class Time(Module, ABC):
|
||
|
"""Base class for tplink time module."""
|
||
|
|
||
|
@property
|
||
|
@abstractmethod
|
||
|
def time(self) -> datetime:
|
||
|
"""Return timezone aware current device time."""
|
||
|
|
||
|
@property
|
||
|
@abstractmethod
|
||
|
def timezone(self) -> tzinfo:
|
||
|
"""Return current timezone."""
|
||
|
|
||
|
@abstractmethod
|
||
|
async def set_time(self, dt: datetime) -> dict:
|
||
|
"""Set the device time."""
|