Add unique_id for BMW ConnectedDrive (#13888)

* Add unique_id for BMW ConnectedDrive

* Changed some comments
This commit is contained in:
Gerard authored and Martin Hjelmare committed 2018-04-15 05:15:52 +02:00
1 parent 1c4da0c4a6
commit 9014e26845
3 files changed
+19 -1

No files matched your search

@@ -46,6 +46,7 @@ class BMWConnectedDriveSensor(BinarySensorDevice):
self._vehicle = vehicle
self._attribute = attribute
self._name = '{} {}'.format(self._vehicle.name, self._attribute)
self._unique_id = '{}-{}'.format(self._vehicle.vin, self._attribute)
self._sensor_name = sensor_name
self._device_class = device_class
self._state = None
@@ -55,6 +56,11 @@ class BMWConnectedDriveSensor(BinarySensorDevice):
"""Data update is triggered from BMWConnectedDriveEntity."""
return False
@property
def unique_id(self):
"""Return the unique ID of the binary sensor."""
return self._unique_id
@property
def name(self):
"""Return the name of the binary sensor."""