def read(self, node, event): event.length = int(node.get('length')) event.numer = int(node.get('numer')) event.denom = int(node.get('denom')) event.metro = int(node.get('metro')) event._32nds = int(node.get('_32nds')) event.before = booleanize(node.get('before'))
def status_update(self): from bluepy import btle _LOGGER.info("Updating %d %s devices", len(self.devices), repr(self)) ret = [] try: devices = self.scanner.scan(float(self.scan_timeout), passive=booleanize(self.scan_passive)) mac_addresses = {device.addr: device for device in devices} for status in self.last_status: device = mac_addresses.get(status.mac, None) status.set_status(device is not None) ret += status.generate_messages(device) except btle.BTLEException as e: logger.log_exception( _LOGGER, "Error during update (%s)", repr(self), type(e).__name__, suppress=True, ) return ret
def read(self, data, event): event.length = int(data[0]) event.numer = int(data[1]) event.denom = int(data[2]) event.metro = int(data[3]) event._32nds = int(data[4]) event.before = booleanize(data[5])
def read(self, data, event): event.length = int(data[0]) event.hour = int(data[1]) event.framep = int(data[2]) event.min = int(data[3]) event.sec = int(data[4]) event.fr = int(data[5]) event.subfr = int(data[6]) event.before = booleanize(data[7])
def read(self, node, event): event.length = int(node.get('length')) event.hour = int(node.get('hour')) event.framep = int(node.get('framep')) event.min = int(node.get('min')) event.sec = int(node.get('sec')) event.fr = int(node.get('fr')) event.subfr = int(node.get('subfr')) event.before = booleanize(node.get('before'))
def status_update(self): devices = self.scanner.scan(float(self.scan_timeout), passive=booleanize(self.scan_passive)) mac_addresses = {device.addr: device for device in devices} ret = [] for status in self.last_status: device = mac_addresses.get(status.mac, None) status.set_status(device is not None) ret += status.generate_messages(device) return ret
def status_update(self): from bluepy import btle _LOGGER.info("Updating %d %s devices", len(self.devices), repr(self)) ret = [] try: devices = self.scanner.scan(float(self.scan_timeout), passive=booleanize(self.scan_passive)) mac_addresses = {device.addr: device for device in devices} for status in self.last_status: device = mac_addresses.get(status.mac, None) status.set_status(device is not None) ret += status.generate_messages(device) ret += self.parse_payload(device, status.name) uniqueId = status.mac.replace(':', '', 5) autoconf_data = self.get_autoconf_data(uniqueId, status.name) if autoconf_data != False: _LOGGER.info("Autoconfiguring %s %s", uniqueId, status.name) ret += autoconf_data except btle.BTLEException as e: logger.log_exception( _LOGGER, "Error during update (%s)", repr(self), type(e).__name__, suppress=True, ) return ret
def read(self, data, event): event.length = int(data[0]) event.MPQN = int(data[1]) event.before = booleanize(data[2])
def read(self, node, event): event.amount = int(node.get('amount')) event.before = booleanize(node.get('before'))
def read(self, data, event): event.length = int(data[0]) event.MSB_number = int(data[1]) event.LSB_number = int(data[2]) event.before = booleanize(data[3])
def read(self, data, event): event.length = int(data[0]) event.text = data[1].strip('"') event.before = booleanize(data[2])
def read(self, node, event): event.length = int(node.get('length')) event.MPQN = int(node.get('MPQN')) event.before = booleanize(node.get('before'))
def read(self, data, event): event.LSB_value = int(data[0]) event.MSB_value = int(data[1]) event.before = booleanize(data[2])
def read(self, node, event): event.controllerType = int(node.get('controllerType')) event.controllerValue = int(node.get('controllerValue')) event.before = booleanize(node.get('before'))
def read(self, data, event): event.length = int(data[0]) event.data = [int(c) for c in data[1].strip('[').strip(']').split(', ')] event.before = booleanize(data[2])
def read(self, node, event): event.length = int(node.get('length')) event.data = [int(c) for c in node.get('data').split(' ')] event.before = booleanize(node.get('before'))
def read(self, node, event): event.LSB_value = int(node.get('LSB_value')) event.MSB_value = int(node.get('MSB_value')) event.before = booleanize(node.get('before'))
def read(self, node, event): event.length = int(node.get('length')) event.key = int(node.get('key')) event.scale = int(node.get('scale')) event.before = booleanize(node.get('before'))
def read(self, node, event): event.length = int(node.get('length')) event.MSB_number = int(node.get('MSB_number')) event.LSB_number = int(node.get('LSB_number')) event.before = booleanize(node.get('before'))
def read(self, node, event): event.length = int(node.get('length')) event.text = node.get('text') event.before = booleanize(node.get('before'))
def read(self, node, event): event.programNumber = int(node.get('programNumber')) event.before = booleanize(node.get('before'))
def read(self, data, event): event.programNumber = int(data[0]) event.before = booleanize(data[1])
def read(self, data, event): event.length = int(data[0]) event.key = int(data[1]) event.scale = int(data[2]) event.before = booleanize(data[3])
def read(self, data, event): event.amount = int(data[0]) event.before = booleanize(data[1])
def read(self, data, event): event.noteNumber = int(data[0]) event.velocity = int(data[1]) event.before = booleanize(data[2])
def read(self, node, event): event.length = int(node.get('length')) event.chan = int(node.get('chan')) event.before = booleanize(node.get('before'))
def read(self, data, event): event.controllerType = int(data[0]) event.controllerValue = int(data[1]) event.before = booleanize(data[2])
def read(self, node, event): event.noteNumber = int(node.get('noteNumber')) event.velocity = int(node.get('velocity')) event.before = booleanize(node.get('before'))