1 """Provide a text platform for MySensors."""
3 from __future__
import annotations
12 from .
import setup_mysensors_platform
13 from .const
import MYSENSORS_DISCOVERY, DiscoveryInfo
14 from .entity
import MySensorsChildEntity
15 from .helpers
import on_unload
20 config_entry: ConfigEntry,
21 async_add_entities: AddEntitiesCallback,
23 """Set up this platform for a specific ConfigEntry(==Gateway)."""
27 """Discover and add a MySensors text entity."""
33 async_add_entities=async_add_entities,
38 config_entry.entry_id,
41 MYSENSORS_DISCOVERY.format(config_entry.entry_id, Platform.TEXT),
48 """Representation of the value of a MySensors Text child node."""
54 """Return the value reported by the text."""
55 return self._values.
get(self.value_type)
58 """Change the value."""
59 self.gateway.set_child_value(
60 self.node_id, self.child_id, self.value_type, value, ack=1
None async_set_value(self, str value)
str|None native_value(self)
web.Response get(self, web.Request request, str config_key)
None on_unload(HomeAssistant hass, GatewayId gateway_id, Callable fnct)
None async_discover(DiscoveryInfo discovery_info)
None async_setup_entry(HomeAssistant hass, ConfigEntry config_entry, AddEntitiesCallback async_add_entities)
list[MySensorsChildEntity]|None setup_mysensors_platform(HomeAssistant hass, Platform domain, DiscoveryInfo discovery_info, type[MySensorsChildEntity]|Mapping[SensorType, type[MySensorsChildEntity]] device_class,(tuple|None) device_args=None, Callable|None async_add_entities=None)
Callable[[], None] async_dispatcher_connect(HomeAssistant hass, str signal, Callable[..., Any] target)