示例#1
0
 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")
示例#2
0
 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")
示例#3
0
 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
示例#4
0
 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)
示例#5
0
 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)
示例#6
0
 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"
示例#8
0
 def state(self):
     """Return the state of the device."""
     return hub.get_first(
         "$.climateValues[?(@.deviceLabel=='%s')].humidity",
         self._device_label)
示例#9
0
 def available(self):
     """Return True if entity is available."""
     return hub.get_first(
         "$.climateValues[?(@.deviceLabel=='%s')].temperature",
         self._device_label) is not None
示例#10
0
 def name(self):
     """Return the name of the device."""
     return hub.get_first(
         "$.eventCounts[?(@.deviceLabel=='%s')].area",
         self._device_label) + " mouse"
示例#11
0
 def name(self):
     """Return the name of the device."""
     return hub.get_first("$.eventCounts[?(@.deviceLabel=='%s')].area",
                          self._device_label) + " mouse"
示例#12
0
 def name(self):
     """Return the name of this camera."""
     return hub.get_first(
         "$.customerImageCameras[?(@.deviceLabel=='%s')].area",
         self._device_label)
示例#13
0
 def available(self):
     """Return True if entity is available."""
     return hub.get_first(
         "$.doorLockStatusList[?(@.deviceLabel=='%s')]",
         self._device_label) is not None
示例#14
0
 def name(self):
     """Return the name of the lock."""
     return hub.get_first(
         "$.doorLockStatusList[?(@.deviceLabel=='%s')].area",
         self._device_label)
示例#15
0
 def state(self):
     """Return the state of the device."""
     return hub.get_first(
         "$.eventCounts[?(@.deviceLabel=='%s')].detections",
         self._device_label)
示例#16
0
 def name(self):
     """Return the name of this camera."""
     return hub.get_first(
         "$.customerImageCameras[?(@.deviceLabel=='%s')].area",
         self._device_label)
示例#17
0
 def available(self):
     """Return True if entity is available."""
     return hub.get_first(
         "$.climateValues[?(@.deviceLabel=='%s')].temperature",
         self._device_label) is not None
示例#18
0
 def state(self):
     """Return the state of the device."""
     return hub.get_first(
         "$.eventCounts[?(@.deviceLabel=='%s')].detections",
         self._device_label)
示例#19
0
 def name(self):
     """Return the name of the device."""
     return hub.get_first(
         "$.climateValues[?(@.deviceLabel=='%s')].deviceArea",
         self._device_label) + " humidity"
示例#20
0
 def name(self):
     """Return the name of the device."""
     return hub.get_first(
         "$.climateValues[?(@.deviceLabel=='%s')].deviceArea",
         self._device_label) + " humidity"
示例#21
0
 def state(self):
     """Return the state of the device."""
     return hub.get_first(
         "$.climateValues[?(@.deviceLabel=='%s')].humidity",
         self._device_label)
示例#22
0
 def name(self):
     """Return the name or location of the smartplug."""
     return hub.get_first(
         "$.smartPlugs[?(@.deviceLabel == '%s')].area",
         self._device_label)
示例#23
0
 def name(self):
     """Return the name of the binary sensor."""
     return hub.get_first(
         "$.doorWindow.doorWindowDevice[?(@.deviceLabel=='%s')].area",
         self._device_label)
示例#24
0
 def available(self):
     """Return True if entity is available."""
     return hub.get_first(
         "$.smartPlugs[?(@.deviceLabel == '%s')]",
         self._device_label) is not None
示例#25
0
 def is_on(self):
     """Return the state of the sensor."""
     return hub.get_first(
         "$.doorWindow.doorWindowDevice[?(@.deviceLabel=='%s')].state",
         self._device_label) == "OPEN"
示例#26
0
 def name(self):
     """Return the name of the binary sensor."""
     return hub.get_first(
         "$.doorWindow.doorWindowDevice[?(@.deviceLabel=='%s')].area",
         self._device_label)
示例#27
0
 def available(self):
     """Return True if entity is available."""
     return hub.get_first(
         "$.doorWindow.doorWindowDevice[?(@.deviceLabel=='%s')]",
         self._device_label) is not None
示例#28
0
 def available(self):
     """Return True if entity is available."""
     return hub.get_first(
         "$.doorWindow.doorWindowDevice[?(@.deviceLabel=='%s')]",
         self._device_label) is not None
示例#29
0
 def name(self):
     """Return the name of the lock."""
     return hub.get_first(
         "$.doorLockStatusList[?(@.deviceLabel=='%s')].area",
         self._device_label)