    def update_scanner(self, scanner_device: BermudaDevice, discoveryinfo: BluetoothScannerDevice):
        """
        Add/Update a scanner entry on this device, indicating a received advertisement.

        This gets called every time a scanner is deemed to have received an advert for
        this device. It only loads data into the structure, all calculations are done
        with calculate_data()

        """
        if format_mac(scanner_device.address) in self.scanners:
            # Device already exists, update it
            self.scanners[format_mac(scanner_device.address)].update_advertisement(
                discoveryinfo,  # the entire BluetoothScannerDevice struct
            )
            device_scanner = self.scanners[format_mac(scanner_device.address)]
        else:
            # Create it
            self.scanners[format_mac(scanner_device.address)] = BermudaDeviceScanner(
                self,
                discoveryinfo,  # the entire BluetoothScannerDevice struct
                self.options,
                scanner_device,
            )
            device_scanner = self.scanners[format_mac(scanner_device.address)]
            # On first creation, we also want to copy our ref_power to it (but not afterwards,
            # since a metadevice might take over that role later)
            device_scanner.ref_power = self.ref_power
        # Let's see if we should update our last_seen based on this...
        if device_scanner.stamp is not None and self.last_seen < device_scanner.stamp:
            self.last_seen = device_scanner.stamp
Add/Update a scanner entry on this device, indicating a received advertisement.

This gets called every time a scanner is deemed to have received an advert for
this device. It only loads data into the structure, all calculations are done
with calculate_data()
custom_components/bermuda/bermuda_device.py