Skip to content

Commit

Permalink
Add icon translations to Husqvarna automower (#111727)
Browse files Browse the repository at this point in the history
* Add icon translations to Husqvarna automower

* fix
  • Loading branch information
joostlek committed Mar 10, 2024
1 parent c1d1479 commit d9f6e4b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
12 changes: 12 additions & 0 deletions homeassistant/components/husqvarna_automower/icons.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"entity": {
"sensor": {
"number_of_charging_cycles": {
"default": "mdi:battery-sync-outline"
},
"number_of_collisions": {
"default": "mdi:counter"
}
}
}
}
2 changes: 0 additions & 2 deletions homeassistant/components/husqvarna_automower/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,15 +105,13 @@ class AutomowerSensorEntityDescription(SensorEntityDescription):
AutomowerSensorEntityDescription(
key="number_of_charging_cycles",
translation_key="number_of_charging_cycles",
icon="mdi:battery-sync-outline",
entity_category=EntityCategory.DIAGNOSTIC,
state_class=SensorStateClass.TOTAL,
value_fn=lambda data: data.statistics.number_of_charging_cycles,
),
AutomowerSensorEntityDescription(
key="number_of_collisions",
translation_key="number_of_collisions",
icon="mdi:counter",
entity_category=EntityCategory.DIAGNOSTIC,
state_class=SensorStateClass.TOTAL,
value_fn=lambda data: data.statistics.number_of_collisions,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@
'options': dict({
}),
'original_device_class': None,
'original_icon': 'mdi:battery-sync-outline',
'original_icon': None,
'original_name': 'Number of charging cycles',
'platform': 'husqvarna_automower',
'previous_unique_id': None,
Expand All @@ -248,7 +248,6 @@
StateSnapshot({
'attributes': ReadOnlyDict({
'friendly_name': 'Test Mower 1 Number of charging cycles',
'icon': 'mdi:battery-sync-outline',
'state_class': <SensorStateClass.TOTAL: 'total'>,
}),
'context': <ANY>,
Expand Down Expand Up @@ -283,7 +282,7 @@
'options': dict({
}),
'original_device_class': None,
'original_icon': 'mdi:counter',
'original_icon': None,
'original_name': 'Number of collisions',
'platform': 'husqvarna_automower',
'previous_unique_id': None,
Expand All @@ -297,7 +296,6 @@
StateSnapshot({
'attributes': ReadOnlyDict({
'friendly_name': 'Test Mower 1 Number of collisions',
'icon': 'mdi:counter',
'state_class': <SensorStateClass.TOTAL: 'total'>,
}),
'context': <ANY>,
Expand Down

0 comments on commit d9f6e4b

Please sign in to comment.