diff --git a/custom_components/leafspy/binary_sensor.py b/custom_components/leafspy/binary_sensor.py index a13e317..e496bd9 100644 --- a/custom_components/leafspy/binary_sensor.py +++ b/custom_components/leafspy/binary_sensor.py @@ -127,6 +127,7 @@ def is_on(self): def device_info(self): """Return device information.""" return { + "name": "Leaf", "identifiers": {(DOMAIN, self._device_id)}, } diff --git a/custom_components/leafspy/device_tracker.py b/custom_components/leafspy/device_tracker.py index 7a13b13..db633a5 100755 --- a/custom_components/leafspy/device_tracker.py +++ b/custom_components/leafspy/device_tracker.py @@ -75,6 +75,11 @@ def unique_id(self): def battery_level(self): """Return the battery level of the car.""" return self._data.get('battery_level') + + @property + def icon(self): + """Return the icon for the device.""" + return 'mdi:car' @property def latitude(self): @@ -105,7 +110,7 @@ def source_type(self): def device_info(self): """Return the device info.""" return { - 'name': self.name, + 'name': 'Leaf', 'identifiers': {(LS_DOMAIN, self._dev_id)}, } diff --git a/custom_components/leafspy/sensor.py b/custom_components/leafspy/sensor.py index b58b77e..b2b82a7 100755 --- a/custom_components/leafspy/sensor.py +++ b/custom_components/leafspy/sensor.py @@ -349,6 +349,7 @@ def native_value(self): def device_info(self): """Return device information.""" return { + "name": "Leaf", "identifiers": {(DOMAIN, self._device_id)}, }