From 3cba2e695cb7e23cc5afd70f2ba2d132a4ae68f9 Mon Sep 17 00:00:00 2001 From: Charles Garwood Date: Wed, 26 Sep 2018 02:56:23 -0400 Subject: [PATCH] Device Registry Support for iOS Sensors (#16862) * Add device_info property to iOS sensors for device registry * Remove unused logger import * Fix spacing * lint * Lint --- homeassistant/components/sensor/ios.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/homeassistant/components/sensor/ios.py b/homeassistant/components/sensor/ios.py index a50d1161676..d206cd1df87 100644 --- a/homeassistant/components/sensor/ios.py +++ b/homeassistant/components/sensor/ios.py @@ -46,6 +46,21 @@ class IOSSensor(Entity): self._state = None self._unit_of_measurement = SENSOR_TYPES[sensor_type][1] + @property + def device_info(self): + """Return information about the device.""" + return { + 'identifiers': { + (ios.DOMAIN, + self._device[ios.ATTR_DEVICE][ios.ATTR_DEVICE_PERMANENT_ID]), + }, + 'name': self._device[ios.ATTR_DEVICE][ios.ATTR_DEVICE_NAME], + 'manufacturer': 'Apple', + 'model': self._device[ios.ATTR_DEVICE][ios.ATTR_DEVICE_TYPE], + 'sw_version': + self._device[ios.ATTR_DEVICE][ios.ATTR_DEVICE_SYSTEM_VERSION], + } + @property def name(self): """Return the name of the iOS sensor."""