1 """Provides a binary sensor which gets its values from a TCP socket."""
3 from __future__
import annotations
5 from typing
import Final
8 PLATFORM_SCHEMA
as BINARY_SENSOR_PLATFORM_SCHEMA,
15 from .common
import TCP_PLATFORM_SCHEMA
16 from .const
import CONF_VALUE_ON
17 from .entity
import TcpEntity
19 PLATFORM_SCHEMA: Final = BINARY_SENSOR_PLATFORM_SCHEMA.extend(TCP_PLATFORM_SCHEMA)
25 add_entities: AddEntitiesCallback,
26 discovery_info: DiscoveryInfoType |
None =
None,
28 """Set up the TCP binary sensor."""
33 """A binary sensor which is on when its state == CONF_VALUE_ON."""
37 """Return true if the binary sensor is on."""
None add_entities(AsusWrtRouter router, AddEntitiesCallback async_add_entities, set[str] tracked)
None setup_platform(HomeAssistant hass, ConfigType config, AddEntitiesCallback add_entities, DiscoveryInfoType|None discovery_info=None)