From b7141901f63bfe3f0826e8c12b704bdae8469c82 Mon Sep 17 00:00:00 2001 From: Robbie Trencheny Date: Mon, 17 Apr 2017 22:58:04 -0700 Subject: [PATCH] Change iOS sensor unique ID to use the device ID --- homeassistant/components/sensor/ios.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/sensor/ios.py b/homeassistant/components/sensor/ios.py index 5f5f4ba0cf0..35f03d7a1c1 100644 --- a/homeassistant/components/sensor/ios.py +++ b/homeassistant/components/sensor/ios.py @@ -56,7 +56,8 @@ class IOSSensor(Entity): @property def unique_id(self): """Return the unique ID of this sensor.""" - return "sensor_ios_battery_{}_{}".format(self.type, self._device_name) + device_id = self._device[ios.ATTR_DEVICE_ID] + return "sensor_ios_battery_{}_{}".format(self.type, device_id) @property def unit_of_measurement(self):