'Initialize the cover.'

def __init__(self, hass, args):

    self.particle_url = 'https://api.particle.io'
    self.hass = hass
    self._name = args['name']
    self.device_id = args['device_id']
    self.access_token = args['access_token']
    self.obtained_token = False
    self._username = args['username']
    self._password = args['password']
    self._state = STATE_UNKNOWN
    self.time_in_state = None
    self.signal = None
    self.sensor = None
    self._unsub_listener_cover = None
    self._available = True
    if (self.access_token is None):
        self.access_token = self.get_token()
        self._obtained_token = True
    try:
        if (self._name is None):
            doorconfig = self._get_variable('doorConfig')
            if (doorconfig['nme'] is not None):
                self._name = doorconfig['nme']
        self.update()
    except requests.exceptions.ConnectionError as ex:
        _LOGGER.error('Unable    to    connect    to    server:    %(reason)s', dict(reason=ex))
        self._state = STATE_OFFLINE
        self._available = False
        self._name = DEFAULT_NAME
    except KeyError as ex:
        _LOGGER.warning('Garadget    device    %(device)s    seems    to    be    offline', dict(device=self.device_id))
        self._name = DEFAULT_NAME
        self._state = STATE_OFFLINE
        self._available = False
