'Get the device state. An exception means UNKNOWN state.'

@property
def state(self):

    try:
        response = requests.get(DEVICE_STATE_URL.format(self.proto, self.host, self.port, self.device_id), timeout=10).json()
        return response.get('state', STATE_UNKNOWN)
    except requests.exceptions.RequestException:
        _LOGGER.error('Could    not    retrieve    device    state    for    %s', self.device_id)
        return STATE_UNKNOWN
