<s> """<STR_LIT>""" <EOL> import logging <EOL> from homeassistant . components . garage_door import GarageDoorDevice <EOL> from homeassistant . const import CONF_ACCESS_TOKEN <EOL> REQUIREMENTS = [ '<STR_LIT>' ] <EOL> def setup_platform ( hass , config , add_devices , discovery_info = None ) : <EOL> """<STR_LIT>""" <EOL> import pywink <EOL> if discovery_info is None : <EOL> token = config . get ( CONF_ACCESS_TOKEN ) <EOL> if token is None : <EOL> logging . getLogger ( __name__ ) . error ( <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" ) <EOL> return <EOL> pywink . set_bearer_token ( token ) <EOL> add_devices ( WinkGarageDoorDevice ( door ) for door in <EOL> pywink . get_garage_doors ( ) ) <EOL> class WinkGarageDoorDevice ( GarageDoorDevice ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , wink ) : <EOL> """<STR_LIT>""" <EOL> self . wink = wink <EOL> @ property <EOL> def unique_id ( self ) : <EOL> """<STR_LIT>""" <EOL> return "<STR_LIT>" . format ( self . __class__ , self . wink . device_id ( ) ) <EOL> @ property <EOL> def name ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . wink . name ( ) <EOL> def update ( self ) : <EOL> """<STR_LIT>""" <EOL> self . wink . update_state ( ) <EOL> @ property <EOL> def is_closed ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . wink . state ( ) == <NUM_LIT:0> <EOL> @ property <EOL> def available ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . wink . available <EOL> def close_door ( self ) : <EOL> """<STR_LIT>""" <EOL> self . wink . set_state ( <NUM_LIT:0> ) <EOL> def open_door ( self ) : <EOL> """<STR_LIT>""" <EOL> self . wink . set_state ( <NUM_LIT:1> ) </s>
