Skip to content

Commit

Permalink
Add entity translations to Bluemaestro (home-assistant#102424)
Browse files Browse the repository at this point in the history
* Add entity translations to Bluemaestro

* Fix

* yes
  • Loading branch information
joostlek authored Apr 7, 2024
1 parent 5630b36 commit 32d62e4
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
6 changes: 2 additions & 4 deletions homeassistant/components/bluemaestro/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
): SensorEntityDescription(
key=f"{BlueMaestroSensorDeviceClass.DEW_POINT}_{Units.TEMP_CELSIUS}",
device_class=SensorDeviceClass.TEMPERATURE,
translation_key="dew_point",
native_unit_of_measurement=UnitOfTemperature.CELSIUS,
state_class=SensorStateClass.MEASUREMENT,
),
Expand Down Expand Up @@ -110,10 +111,7 @@ def sensor_update_to_bluetooth_data_update(
device_key_to_bluetooth_entity_key(device_key): sensor_values.native_value
for device_key, sensor_values in sensor_update.entity_values.items()
},
entity_names={
device_key_to_bluetooth_entity_key(device_key): sensor_values.name
for device_key, sensor_values in sensor_update.entity_values.items()
},
entity_names={},
)


Expand Down
7 changes: 7 additions & 0 deletions homeassistant/components/bluemaestro/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,12 @@
"already_in_progress": "[%key:common::config_flow::abort::already_in_progress%]",
"already_configured": "[%key:common::config_flow::abort::already_configured_device%]"
}
},
"entity": {
"sensor": {
"dew_point": {
"name": "Dew point"
}
}
}
}
10 changes: 5 additions & 5 deletions tests/components/bluemaestro/snapshots/test_sensor.ambr
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,11 @@
}),
'original_device_class': <SensorDeviceClass.TEMPERATURE: 'temperature'>,
'original_icon': None,
'original_name': 'Dew Point',
'original_name': 'Dew point',
'platform': 'bluemaestro',
'previous_unique_id': None,
'supported_features': 0,
'translation_key': None,
'translation_key': 'dew_point',
'unique_id': 'aa:bb:cc:dd:ee:ff-dew_point',
'unit_of_measurement': <UnitOfTemperature.CELSIUS: '°C'>,
})
Expand All @@ -89,7 +89,7 @@
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'temperature',
'friendly_name': 'Tempo Disc THD EEFF Dew Point',
'friendly_name': 'Tempo Disc THD EEFF Dew point',
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
'unit_of_measurement': <UnitOfTemperature.CELSIUS: '°C'>,
}),
Expand Down Expand Up @@ -178,7 +178,7 @@
}),
'original_device_class': <SensorDeviceClass.SIGNAL_STRENGTH: 'signal_strength'>,
'original_icon': None,
'original_name': 'Signal Strength',
'original_name': 'Signal strength',
'platform': 'bluemaestro',
'previous_unique_id': None,
'supported_features': 0,
Expand All @@ -191,7 +191,7 @@
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'signal_strength',
'friendly_name': 'Tempo Disc THD EEFF Signal Strength',
'friendly_name': 'Tempo Disc THD EEFF Signal strength',
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
'unit_of_measurement': 'dBm',
}),
Expand Down

0 comments on commit 32d62e4

Please sign in to comment.