init home-assistant
This commit is contained in:
20
home-assistant/tests/components/time/common.py
Normal file
20
home-assistant/tests/components/time/common.py
Normal file
@@ -0,0 +1,20 @@
|
||||
"""Common helpers for time entity component tests."""
|
||||
|
||||
from datetime import time
|
||||
|
||||
from homeassistant.components.time import TimeEntity
|
||||
|
||||
from tests.common import MockEntity
|
||||
|
||||
|
||||
class MockTimeEntity(MockEntity, TimeEntity):
|
||||
"""Mock time class."""
|
||||
|
||||
@property
|
||||
def native_value(self) -> time | None:
|
||||
"""Return the current time."""
|
||||
return self._handle("native_value")
|
||||
|
||||
def set_value(self, value: time) -> None:
|
||||
"""Change the time."""
|
||||
self._values["native_value"] = value
|
||||
Reference in New Issue
Block a user