コード例 #1
0
 def device_info(self) -> entity.DeviceInfo:
     """Return device info."""
     return entity.DeviceInfo(
         connections={(CONNECTION_NETWORK_MAC, self._sensor_data.hub_mac_address)},
         manufacturer="IoTaWatt",
         model="IoTaWatt",
     )
コード例 #2
0
ファイル: __init__.py プロジェクト: jbouwh/core
 def device_info(self) -> entity.DeviceInfo:
     """Return device registry information for this entity."""
     return entity.DeviceInfo(
         identifiers={(DOMAIN, self._device.device_id)},
         manufacturer="Abode",
         model=self._device.type,
         name=self._device.name,
     )
コード例 #3
0
 def device_info(self) -> entity.DeviceInfo:
     """Return the device info."""
     return entity.DeviceInfo(
         identifiers={(DOMAIN, self.unique_id)},
         manufacturer="Rollease Acmeda",
         name=self.roller.name,
         via_device=(DOMAIN, self.roller.hub.id),
     )
コード例 #4
0
 def device_info(self) -> entity.DeviceInfo:
     """Get device info."""
     sw_version = self._sensor_data.firmware_version
     return entity.DeviceInfo(
         identifiers={(DOMAIN, self._device_id)},
         manufacturer="Plaato",
         model=self._device_type,
         name=self._device_name,
         sw_version=sw_version if sw_version != "" else None,
     )
コード例 #5
0
 def device_info(self) -> entity.DeviceInfo:
     """Return a device description for device registry."""
     zha_device_info = self._zha_device.device_info
     ieee = zha_device_info["ieee"]
     return entity.DeviceInfo(
         connections={(CONNECTION_ZIGBEE, ieee)},
         identifiers={(DOMAIN, ieee)},
         manufacturer=zha_device_info[ATTR_MANUFACTURER],
         model=zha_device_info[ATTR_MODEL],
         name=zha_device_info[ATTR_NAME],
         via_device=(DOMAIN, self.hass.data[DATA_ZHA][DATA_ZHA_BRIDGE_ID]),
     )
コード例 #6
0
    def device_info(self) -> entity.DeviceInfo:
        """Return the device info.

        Links individual entities together in the hass device registry.
        """
        return entity.DeviceInfo(
            identifiers={(HUE_DOMAIN, self.device_id)},
            manufacturer=self.primary_sensor.manufacturername,
            model=(self.primary_sensor.productname
                   or self.primary_sensor.modelid),
            name=self.primary_sensor.name,
            sw_version=self.primary_sensor.swversion,
            via_device=(HUE_DOMAIN, self.bridge.api.config.bridgeid),
        )
コード例 #7
0
    def device_info(self) -> entity.DeviceInfo:
        """Return device specific attributes."""
        manufacturer = (self._meter_info.manufacturer
                        if self._meter_info.manufacturer else
                        self._meter_info.manufacturer_id)

        meter_type = (self._meter_info.type
                      if self._meter_info.type else self._meter_info.type_id)

        return entity.DeviceInfo(
            name=f"{manufacturer} {meter_type}",
            identifiers={(
                DOMAIN,
                self._meter_info.unique_id
                if self._meter_info.unique_id else self._config_entry_id,
            )},
            manufacturer=manufacturer,
            model=meter_type,
            sw_version=self._meter_info.list_version_id,
        )