<s> """<STR_LIT>""" <EOL> import logging <EOL> from homeassistant . components . binary_sensor import BinarySensorDevice <EOL> from homeassistant . components . sensor . tcp import Sensor , CONF_VALUE_ON <EOL> _LOGGER = logging . getLogger ( __name__ ) <EOL> def setup_platform ( hass , config , add_entities , discovery_info = None ) : <EOL> """<STR_LIT>""" <EOL> if not BinarySensor . validate_config ( config ) : <EOL> return False <EOL> add_entities ( ( BinarySensor ( hass , config ) , ) ) <EOL> class BinarySensor ( BinarySensorDevice , Sensor ) : <EOL> """<STR_LIT>""" <EOL> required = ( CONF_VALUE_ON , ) <EOL> @ property <EOL> def is_on ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . _state == self . _config [ CONF_VALUE_ON ] </s>
