def add_known_devices(self, plm):
        """Add devices from the saved devices or from the device overrides."""
        from insteonplm.devices import ALDBStatus
        for addr in self._saved_devices:
            if not self._devices.get(addr):
                saved_device = self._saved_devices.get(Address(addr).id, {})
                cat = saved_device.get('cat')
                subcat = saved_device.get('subcat')
                product_key = saved_device.get('firmware')
                product_key = saved_device.get('product_key', product_key)
                device = self.create_device_from_category(
                    plm, addr, cat, subcat, product_key)
                if device:
                    _LOGGER.debug('Device with id %s added to device list '
                                  'from saved device data.', addr)
                    aldb_status = saved_device.get('aldb_status', 0)
                    device.aldb.status = ALDBStatus(aldb_status)
                    aldb = saved_device.get('aldb', {})
                    device.aldb.load_saved_records(aldb_status, aldb)
                    self[addr] = device
        for addr in self._overrides:
            if not self._devices.get(addr):
                device_override = self._overrides.get(Address(addr).id, {})
                cat = device_override.get('cat')
                subcat = device_override.get('subcat')
                product_key = device_override.get('firmware')
                product_key = device_override.get('product_key', product_key)
                device = self.create_device_from_category(
                    plm, addr, cat, subcat, product_key)
                if device:
                    _LOGGER.debug('Device with id %s added to device list '
                                  'from device override data.', addr)
                    self[addr] = device
def add_known_devices ( self , plm ) : from insteonplm . devices import ALDBStatus for addr in self . _saved_devices : if not self . _devices . get ( addr ) : saved_device = self . _saved_devices . get ( Address ( addr ) . id , { } ) cat = saved_device . get ( 'cat' ) subcat = saved_device . get ( 'subcat' ) product_key = saved_device . get ( 'firmware' ) product_key = saved_device . get ( 'product_key' , product_key ) device = self . create_device_from_category ( plm , addr , cat , subcat , product_key ) if device : _LOGGER . debug ( 'Device with id %s added to device list ' 'from saved device data.' , addr ) aldb_status = saved_device . get ( 'aldb_status' , 0 ) device . aldb . status = ALDBStatus ( aldb_status ) aldb = saved_device . get ( 'aldb' , { } ) device . aldb . load_saved_records ( aldb_status , aldb ) self [ addr ] = device for addr in self . _overrides : if not self . _devices . get ( addr ) : device_override = self . _overrides . get ( Address ( addr ) . id , { } ) cat = device_override . get ( 'cat' ) subcat = device_override . get ( 'subcat' ) product_key = device_override . get ( 'firmware' ) product_key = device_override . get ( 'product_key' , product_key ) device = self . create_device_from_category ( plm , addr , cat , subcat , product_key ) if device : _LOGGER . debug ( 'Device with id %s added to device list ' 'from device override data.' , addr ) self [ addr ] = device
Add devices from the saved devices or from the device overrides.