예제 #1
0
    def device_info(self):
        """Return the device_info of the device."""
        device_info = {
            "identifiers": {(DOMAIN, self._device.device_id)},
            "name": self.name,
            "manufacturer": MANUFACTURER,
            "sw_version": self._device.firmware_version,
        }
        model = KNOWN_MODELS.get(self._device.device_id[2:4])
        if model:
            device_info["model"] = model

        return device_info
예제 #2
0
 def device_info(self):
     """Return the device_info of the device."""
     model = (KNOWN_MODELS.get(self._device.device_id[2:4])
              if self._device.device_id is not None else None)
     via_device: tuple[str, str] | None = None
     if self._device.parent_device_id:
         via_device = (DOMAIN, self._device.parent_device_id)
     return DeviceInfo(
         identifiers={(DOMAIN, self._device.device_id)},
         manufacturer=MANUFACTURER,
         model=model,
         name=self._device.name,
         sw_version=self._device.firmware_version,
         via_device=via_device,
     )
예제 #3
0
 def device_info(self):
     """Return the device_info of the device."""
     device_info = {
         "identifiers": {(DOMAIN, self._device.device_id)},
         "name": self._device.name,
         "manufacturer": MANUFACTURER,
         "sw_version": self._device.firmware_version,
     }
     model = (
         KNOWN_MODELS.get(self._device.device_id[2:4])
         if self._device.device_id is not None
         else None
     )
     if model:
         device_info["model"] = model
     if self._device.parent_device_id:
         device_info["via_device"] = (DOMAIN, self._device.parent_device_id)
     return device_info