def update(self): """Update alarm status.""" hub.update_overview() status = hub.get_first("$.armState.statusType") if status == 'DISARMED': self._state = STATE_ALARM_DISARMED elif status == 'ARMED_HOME': self._state = STATE_ALARM_ARMED_HOME elif status == 'ARMED_AWAY': self._state = STATE_ALARM_ARMED_AWAY elif status != 'PENDING': _LOGGER.error('Unknown alarm state %s', status) self._changed_by = hub.get_first("$.armState.name")
def is_on(self): """Return true if on.""" if time() - self._change_timestamp < 10: return self._state self._state = hub.get_first( "$.smartPlugs[?(@.deviceLabel == '%s')].currentState", self._device_label) == "ON" return self._state
def update(self): """Update lock status.""" if time() - self._change_timestamp < 10: return hub.update_overview() status = hub.get_first( "$.doorLockStatusList[?(@.deviceLabel=='%s')].lockedState", self._device_label) if status == 'UNLOCKED': self._state = STATE_UNLOCKED elif status == 'LOCKED': self._state = STATE_LOCKED elif status != 'PENDING': _LOGGER.error('Unknown lock state %s', status) self._changed_by = hub.get_first( "$.doorLockStatusList[?(@.deviceLabel=='%s')].userString", self._device_label)
def available(self): """Return True if entity is available.""" return hub.get_first("$.doorLockStatusList[?(@.deviceLabel=='%s')]", self._device_label) is not None
def is_on(self): """Return the state of the sensor.""" return hub.get_first( "$.doorWindow.doorWindowDevice[?(@.deviceLabel=='%s')].state", self._device_label) == "OPEN"
def state(self): """Return the state of the device.""" return hub.get_first( "$.climateValues[?(@.deviceLabel=='%s')].humidity", self._device_label)
def available(self): """Return True if entity is available.""" return hub.get_first( "$.climateValues[?(@.deviceLabel=='%s')].temperature", self._device_label) is not None
def name(self): """Return the name of the device.""" return hub.get_first( "$.eventCounts[?(@.deviceLabel=='%s')].area", self._device_label) + " mouse"
def name(self): """Return the name of the device.""" return hub.get_first("$.eventCounts[?(@.deviceLabel=='%s')].area", self._device_label) + " mouse"
def name(self): """Return the name of this camera.""" return hub.get_first( "$.customerImageCameras[?(@.deviceLabel=='%s')].area", self._device_label)
def available(self): """Return True if entity is available.""" return hub.get_first( "$.doorLockStatusList[?(@.deviceLabel=='%s')]", self._device_label) is not None
def name(self): """Return the name of the lock.""" return hub.get_first( "$.doorLockStatusList[?(@.deviceLabel=='%s')].area", self._device_label)
def state(self): """Return the state of the device.""" return hub.get_first( "$.eventCounts[?(@.deviceLabel=='%s')].detections", self._device_label)
def name(self): """Return the name of the device.""" return hub.get_first( "$.climateValues[?(@.deviceLabel=='%s')].deviceArea", self._device_label) + " humidity"
def name(self): """Return the name or location of the smartplug.""" return hub.get_first( "$.smartPlugs[?(@.deviceLabel == '%s')].area", self._device_label)
def name(self): """Return the name of the binary sensor.""" return hub.get_first( "$.doorWindow.doorWindowDevice[?(@.deviceLabel=='%s')].area", self._device_label)
def available(self): """Return True if entity is available.""" return hub.get_first( "$.smartPlugs[?(@.deviceLabel == '%s')]", self._device_label) is not None
def available(self): """Return True if entity is available.""" return hub.get_first( "$.doorWindow.doorWindowDevice[?(@.deviceLabel=='%s')]", self._device_label) is not None