From b5b4f77b09390332397d9985b2d39eece742f525 Mon Sep 17 00:00:00 2001 From: Fredrik Ljunggren Date: Sat, 7 Jan 2023 11:06:41 +0100 Subject: [PATCH] Propose to remove the word 'sensor' from sensor names This is a proposal for a minor cleanup. Currently, sensors have the name "foo sensor". For example, the range sensor gets the entity id sensor.model_range_sensor. I propose to remove the word sensor to shorten the entity id of each sensor, as it is redundant information. This change does not affect those who have already configured this component in hass. The sensor names will remain the same. It only affects new installations. --- custom_components/porscheconnect/const.py | 42 +++++++++++------------ 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/custom_components/porscheconnect/const.py b/custom_components/porscheconnect/const.py index 62ae3cb..d6af28c 100644 --- a/custom_components/porscheconnect/const.py +++ b/custom_components/porscheconnect/const.py @@ -101,27 +101,27 @@ class SensorAttr: DATA_MAP = [ SensorMeta( - "mileage sensor", + "mileage", "mileage", "mdi:counter", attributes=[SensorAttr("oil level", "oilLevel")], ), SensorMeta( - "battery sensor", "batteryLevel", "mdi:battery", SensorDeviceClass.BATTERY + "battery", "batteryLevel", "mdi:battery", SensorDeviceClass.BATTERY ), - SensorMeta("fuel sensor", "fuelLevel", "mdi:gauge"), + SensorMeta("fuel", "fuelLevel", "mdi:gauge"), SensorMeta( - "range sensor", + "range", "remainingRanges.electricalRange.distance", "mdi:gauge", ), SensorMeta( - "range sensor", + "range", "remainingRanges.conventionalRange.distance", "mdi:gauge", ), SensorMeta( - "charging profile sensor", + "charging profile", "chargingProfiles.currentProfileId", "mdi:battery-charging", attributes=[SensorAttr("profiles", "chargingProfilesDict")], @@ -143,7 +143,7 @@ class SensorAttr: BinarySensorMeta("parking brake", "parkingBreak", "mdi:lock"), SensorMeta("doors", "overallOpenStatus", "mdi:lock"), SensorMeta( - "charger sensor", + "charger", "chargingStatus", "mdi:ev-station", attributes=[ @@ -168,13 +168,13 @@ class SensorAttr: } DEVICE_NAMES = { - "mileage": "mileage sensor", - "batteryLevel": "battery sensor", - "fuelLevel": "fuel sensor", - "oilLevel": "oil sensor", - "remainingRanges.conventionalRange.distance": "range sensor", - "remainingRanges.electricalRange.distance": "range sensor", - "chargingStatus": "charger sensor", + "mileage": "mileage", + "batteryLevel": "battery", + "fuelLevel": "fuel", + "oilLevel": "oil", + "remainingRanges.conventionalRange.distance": "range", + "remainingRanges.electricalRange.distance": "range", + "chargingStatus": "charger", "chargingProfiles.currentProfileId": "charging profile", "directClimatisation.climatisationState": "climatisation", "directCharge.isActive": "direct charge", @@ -183,16 +183,16 @@ class SensorAttr: } ICONS = { - "battery sensor": "mdi:battery", - "range sensor": "mdi:gauge", - "mileage sensor": "mdi:counter", - "parking brake sensor": "mdi:car-brake-parking", - "charger sensor": "mdi:ev-station", + "battery": "mdi:battery", + "range": "mdi:gauge", + "mileage": "mdi:counter", + "parking brake": "mdi:car-brake-parking", + "charger": "mdi:ev-station", "charger switch": "mdi:battery-charging", "update switch": "mdi:update", "maxrange switch": "mdi:gauge-full", - "temperature sensor": "mdi:thermometer", + "temperature": "mdi:thermometer", "location tracker": "mdi:crosshairs-gps", - "charging rate sensor": "mdi:speedometer", + "charging rate": "mdi:speedometer", "sentry mode switch": "mdi:shield-car", }