From 7a724b6212c063861f6cdcb6861635e8bf292f87 Mon Sep 17 00:00:00 2001 From: ReneNulschDE Date: Fri, 9 Feb 2024 22:14:30 +0100 Subject: [PATCH] Fix Sensor Names --- custom_components/mysmartbike/sensor.py | 1 - custom_components/mysmartbike/translations/en.json | 12 +++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/custom_components/mysmartbike/sensor.py b/custom_components/mysmartbike/sensor.py index 1fca76f..8762312 100644 --- a/custom_components/mysmartbike/sensor.py +++ b/custom_components/mysmartbike/sensor.py @@ -110,7 +110,6 @@ def __init__( self.device = device self._attr_unique_id = util.slugify(f"{device.serial} {description.key}") - self._attr_name = description.key self._attr_should_poll = False self.entity_description = description diff --git a/custom_components/mysmartbike/translations/en.json b/custom_components/mysmartbike/translations/en.json index 4acfd51..31285ab 100755 --- a/custom_components/mysmartbike/translations/en.json +++ b/custom_components/mysmartbike/translations/en.json @@ -41,5 +41,15 @@ "info": { "api_endpoint_reachable": "MySmartBike API endpoint reachable" } + }, + "entity": { + "sensor": { + "odometry": { + "name": "Ride distance" + }, + "state_of_charge": { + "name": "State of charge" + } + } } -} +} \ No newline at end of file