Change iOS sensor unique ID to use the device ID

This commit is contained in:
Robbie Trencheny 2017-04-17 22:58:04 -07:00
parent 919bb08d02
commit b7141901f6
No known key found for this signature in database
GPG Key ID: 57406F414538A33B

View File

@ -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):