mirror of
https://github.com/home-assistant/core.git
synced 2026-12-03 04:08:19 -04:00
Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
21 lines
526 B
Python
21 lines
526 B
Python
"""Common helpers for time entity component tests."""
|
|
|
|
from datetime import time
|
|
|
|
from pytest_homeassistant.common import MockEntity
|
|
|
|
from homeassistant.components.time import TimeEntity
|
|
|
|
|
|
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
|