<s> """<STR_LIT>""" <EOL> import voluptuous as vol <EOL> import homeassistant . components . nest as nest <EOL> from homeassistant . components . binary_sensor import BinarySensorDevice <EOL> from homeassistant . components . sensor . nest import NestSensor <EOL> from homeassistant . const import ( <EOL> CONF_PLATFORM , CONF_SCAN_INTERVAL , CONF_MONITORED_CONDITIONS <EOL> ) <EOL> DEPENDENCIES = [ '<STR_LIT>' ] <EOL> BINARY_TYPES = [ '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' ] <EOL> PLATFORM_SCHEMA = vol . Schema ( { <EOL> vol . Required ( CONF_PLATFORM ) : nest . DOMAIN , <EOL> vol . Optional ( CONF_SCAN_INTERVAL ) : <EOL> vol . All ( vol . Coerce ( int ) , vol . Range ( min = <NUM_LIT:1> ) ) , <EOL> vol . Required ( CONF_MONITORED_CONDITIONS ) : [ vol . In ( BINARY_TYPES ) ] , <EOL> } ) <EOL> def setup_platform ( hass , config , add_devices , discovery_info = None ) : <EOL> """<STR_LIT>""" <EOL> for structure , device in nest . devices ( ) : <EOL> add_devices ( [ NestBinarySensor ( structure , device , variable ) <EOL> for variable in config [ CONF_MONITORED_CONDITIONS ] ] ) <EOL> class NestBinarySensor ( NestSensor , BinarySensorDevice ) : <EOL> """<STR_LIT>""" <EOL> @ property <EOL> def is_on ( self ) : <EOL> """<STR_LIT>""" <EOL> return bool ( getattr ( self . device , self . variable ) ) </s>
