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