diff --git a/custom_components/ftms/button.py b/custom_components/ftms/button.py index 752bd6c..0192162 100644 --- a/custom_components/ftms/button.py +++ b/custom_components/ftms/button.py @@ -13,31 +13,11 @@ _LOGGER = logging.getLogger(__name__) -_RESET = ButtonEntityDescription( - key=c.RESET, - icon="mdi:lock-reset", -) - -_STOP = ButtonEntityDescription( - key=c.STOP, - icon="mdi:timer-stop", -) - -_START = ButtonEntityDescription( - key=c.START, - icon="mdi:timer-play", -) - -_PAUSE = ButtonEntityDescription( - key=c.PAUSE, - icon="mdi:timer-pause", -) - _ENTITIES = ( - _RESET, - _STOP, - _START, - _PAUSE, + c.RESET, + c.STOP, + c.START, + c.PAUSE, ) @@ -51,7 +31,7 @@ async def async_setup_entry( entities = [ FtmsButtonEntity( entry=entry, - description=description, + description=ButtonEntityDescription(key=description), ) for description in _ENTITIES ] diff --git a/custom_components/ftms/number.py b/custom_components/ftms/number.py index b59e798..626fae3 100644 --- a/custom_components/ftms/number.py +++ b/custom_components/ftms/number.py @@ -20,12 +20,10 @@ _RESISTANCE_LEVEL: dict[str, Any] = { "key": c.TARGET_RESISTANCE, - "icon": "mdi:chart-timeline-variant", } _POWER: dict[str, Any] = { "key": c.TARGET_POWER, - "icon": "mdi:chart-timeline-variant", "device_class": NumberDeviceClass.POWER, "native_unit_of_measurement": UnitOfPower.WATT, } diff --git a/custom_components/ftms/sensor.py b/custom_components/ftms/sensor.py index 81775fe..bde711e 100644 --- a/custom_components/ftms/sensor.py +++ b/custom_components/ftms/sensor.py @@ -18,14 +18,12 @@ key=c.CADENCE_AVERAGE, native_unit_of_measurement="rpm", state_class=SensorStateClass.MEASUREMENT, - icon="mdi:horizontal-rotate-counterclockwise", ) _CADENCE_INSTANT = SensorEntityDescription( key=c.CADENCE_INSTANT, native_unit_of_measurement="rpm", state_class=SensorStateClass.MEASUREMENT, - icon="mdi:horizontal-rotate-counterclockwise", ) _DISTANCE_TOTAL = SensorEntityDescription( @@ -33,7 +31,6 @@ device_class=SensorDeviceClass.DISTANCE, native_unit_of_measurement=UnitOfLength.METERS, state_class=SensorStateClass.TOTAL, - icon="mdi:map-marker-distance", ) _ELEVATION_GAIN_NEGATIVE = SensorEntityDescription( @@ -41,7 +38,6 @@ device_class=SensorDeviceClass.DISTANCE, native_unit_of_measurement=UnitOfLength.METERS, state_class=SensorStateClass.TOTAL, - icon="mdi:stairs-down", ) _ELEVATION_GAIN_POSITIVE = SensorEntityDescription( @@ -49,61 +45,52 @@ device_class=SensorDeviceClass.DISTANCE, native_unit_of_measurement=UnitOfLength.METERS, state_class=SensorStateClass.TOTAL, - icon="mdi:stairs-up", ) _ENERGY_PER_HOUR = SensorEntityDescription( key=c.ENERGY_PER_HOUR, native_unit_of_measurement="kcal", state_class=SensorStateClass.MEASUREMENT, - icon="mdi:food", ) _ENERGY_PER_MINUTE = SensorEntityDescription( key=c.ENERGY_PER_MINUTE, native_unit_of_measurement="kcal", state_class=SensorStateClass.MEASUREMENT, - icon="mdi:food", ) _ENERGY_TOTAL = SensorEntityDescription( key=c.ENERGY_TOTAL, native_unit_of_measurement="kcal", state_class=SensorStateClass.TOTAL, - icon="mdi:food", ) _FORCE_ON_BELT = SensorEntityDescription( key=c.FORCE_ON_BELT, native_unit_of_measurement="N", state_class=SensorStateClass.MEASUREMENT, - icon="mdi:food", ) _HEART_RATE = SensorEntityDescription( key=c.HEART_RATE, - icon="mdi:heart-pulse", native_unit_of_measurement="bpm", state_class=SensorStateClass.MEASUREMENT, ) _INCLINATION = SensorEntityDescription( key=c.INCLINATION, - icon="mdi:angle-acute", native_unit_of_measurement="%", state_class=SensorStateClass.MEASUREMENT, ) _METABOLIC_EQUIVALENT = SensorEntityDescription( key=c.METABOLIC_EQUIVALENT, - icon="mdi:heart-pulse", native_unit_of_measurement="meta", state_class=SensorStateClass.MEASUREMENT, ) _MOVEMENT_DIRECTION = SensorEntityDescription( key=c.MOVEMENT_DIRECTION, - icon="mdi:swap-horizontal-bold", device_class=SensorDeviceClass.ENUM, options=["forward", "backward"], ) @@ -113,7 +100,6 @@ device_class=SensorDeviceClass.SPEED, native_unit_of_measurement=UnitOfSpeed.KILOMETERS_PER_HOUR, state_class=SensorStateClass.MEASUREMENT, - icon="mdi:run", ) _PACE_INSTANT = SensorEntityDescription( @@ -121,7 +107,6 @@ device_class=SensorDeviceClass.SPEED, native_unit_of_measurement=UnitOfSpeed.KILOMETERS_PER_HOUR, state_class=SensorStateClass.MEASUREMENT, - icon="mdi:run", ) _POWER_AVERAGE = SensorEntityDescription( @@ -147,14 +132,12 @@ _RAMP_ANGLE = SensorEntityDescription( key=c.RAMP_ANGLE, - device_class=SensorDeviceClass.POWER, - native_unit_of_measurement=UnitOfPower.WATT, + native_unit_of_measurement="%", state_class=SensorStateClass.MEASUREMENT, ) _RESISTANCE_LEVEL = SensorEntityDescription( key=c.RESISTANCE_LEVEL, - icon="mdi:chart-timeline-variant", ) _SPEED_AVERAGE = SensorEntityDescription( @@ -176,7 +159,6 @@ device_class=SensorDeviceClass.DURATION, native_unit_of_measurement=UnitOfTime.SECONDS, state_class=SensorStateClass.MEASUREMENT, - icon="mdi:rowing", ) _SPLIT_TIME_INSTANT = SensorEntityDescription( @@ -184,7 +166,6 @@ device_class=SensorDeviceClass.DURATION, native_unit_of_measurement=UnitOfTime.SECONDS, state_class=SensorStateClass.MEASUREMENT, - icon="mdi:rowing", ) _STEP_RATE_AVERAGE = SensorEntityDescription( @@ -234,7 +215,6 @@ device_class=SensorDeviceClass.DURATION, native_unit_of_measurement=UnitOfTime.SECONDS, state_class=SensorStateClass.TOTAL, - icon="mdi:timer-play", ) _TIME_REMAINING = SensorEntityDescription( @@ -242,7 +222,6 @@ device_class=SensorDeviceClass.DURATION, native_unit_of_measurement=UnitOfTime.SECONDS, state_class=SensorStateClass.TOTAL, - icon="mdi:timer-stop", ) _ENTITIES = { diff --git a/custom_components/ftms/translations/en.json b/custom_components/ftms/translations/en.json index f839018..5dfa25c 100644 --- a/custom_components/ftms/translations/en.json +++ b/custom_components/ftms/translations/en.json @@ -124,9 +124,6 @@ "split_time_instant": { "name": "Split time" }, - "step_count": { - "name": "Step count" - }, "step_rate_average": { "name": "Step rate average" }, @@ -207,7 +204,6 @@ "speed_instant": "Speed", "split_time_average": "Split time average", "split_time_instant": "Split time", - "step_count": "Step count", "step_rate_average": "Step rate average", "step_rate_instant": "Step rate", "stride_count": "Stride count", diff --git a/custom_components/ftms/translations/icons.json b/custom_components/ftms/translations/icons.json index 9b11a67..6bac606 100644 --- a/custom_components/ftms/translations/icons.json +++ b/custom_components/ftms/translations/icons.json @@ -1,5 +1,123 @@ { "entity": { + "button": { + "start": { + "default": "mdi:timer-play" + }, + "stop": { + "default": "mdi:timer-stop" + }, + "pause": { + "default": "mdi:timer-pause" + }, + "reset": { + "default": "mdi:lock-reset" + } + }, + "number": { + "target_resistance": { + "default": "mdi:chart-timeline-variant" + }, + "target_power": { + "default": "mdi:chart-timeline-variant" + } + }, + "sensor": { + "cadence_average": { + "default": "mdi:horizontal-rotate-counterclockwise" + }, + "cadence_instant": { + "default": "mdi:horizontal-rotate-counterclockwise" + }, + "distance_total": { + "default": "mdi:map-marker-distance" + }, + "elevation_gain_negative": { + "default": "mdi:stairs-down" + }, + "elevation_gain_positive": { + "default": "mdi:stairs-up" + }, + "energy_per_hour": { + "default": "mdi:food" + }, + "energy_per_minute": { + "default": "mdi:food" + }, + "energy_total": { + "default": "mdi:food" + }, + "force_on_belt": { + "default": "mdi:food" + }, + "heart_rate": { + "default": "mdi:heart-pulse" + }, + "inclination": { + "default": "mdi:angle-acute" + }, + "metabolic_equivalent": { + "default": "mdi:heart-pulse" + }, + "movement_direction": { + "default": "mdi:arrow-left-right-bold-outline", + "state": { + "forward": "mdi:arrow-right-bold-outline", + "backward": "mdi:arrow-left-bold-outline" + } + }, + "pace_average": { + "default": "mdi:run" + }, + "pace_instant": { + "default": "mdi:run" + }, + "power_average": { + "default": "mdi:run" + }, + "power_instant": { + "default": "mdi:run" + }, + "power_output": { + "default": "mdi:run" + }, + "ramp_angle": { + "default": "mdi:angle-acute" + }, + "resistance_level": { + "default": "mdi:chart-timeline-variant" + }, + "split_time_average": { + "default": "mdi:rowing" + }, + "split_time_instant": { + "default": "mdi:rowing" + }, + "step_rate_average": { + "default": "mdi:run" + }, + "step_rate_instant": { + "default": "mdi:run" + }, + "stride_count": { + "default": "mdi:run" + }, + "stroke_count": { + "default": "mdi:rowing" + }, + "stroke_rate_average": { + "default": "mdi:rowing" + }, + "stroke_rate_instant": { + "default": "mdi:rowing" + }, + "time_elapsed": { + "default": "mdi:timer-play" + }, + "time_remaining": { + "default": "mdi:timer-stop" + } + }, "switch": { "connection": { "default": "mdi:bluetooth-off", diff --git a/custom_components/ftms/translations/ru.json b/custom_components/ftms/translations/ru.json index 16c3098..65c5814 100644 --- a/custom_components/ftms/translations/ru.json +++ b/custom_components/ftms/translations/ru.json @@ -124,9 +124,6 @@ "split_time_instant": { "name": "Темп гребли" }, - "step_count": { - "name": "Шаги" - }, "step_rate_average": { "name": "Средняя частота шага" }, @@ -207,7 +204,6 @@ "speed_instant": "Скорость", "split_time_average": "Средний темп гребли", "split_time_instant": "Темп гребли", - "step_count": "Шаги", "step_rate_average": "Средняя частота шага", "step_rate_instant": "Частота шага", "stride_count": "Полные шаги",