code: def is_on(self):
          
          if self._type == 'Occupancy':
              return self.status not in CONST.STATUS_ONLINE
          return self.status not in (CONST.STATUS_OFF, CONST.STATUS_OFFLINE,
                                     CONST.STATUS_CLOSED)
docs: Get sensor state.
  
          Assume offline or open (worst case).