1 """Support for esphome dates."""
3 from __future__
import annotations
5 from datetime
import date
6 from functools
import partial
8 from aioesphomeapi
import DateInfo, DateState
12 from .entity
import EsphomeEntity, esphome_state_property, platform_async_setup_entry
16 """A date implementation for esphome."""
19 @esphome_state_property
21 """Return the state of the entity."""
23 if state.missing_state:
25 return date(state.year, state.month, state.day)
28 """Update the current date."""
29 self.
_client_client.date_command(self.
_key_key, value.year, value.month, value.day)
32 async_setup_entry = partial(
33 platform_async_setup_entry,
35 entity_type=EsphomeDate,
None async_set_value(self, date value)
date|None native_value(self)