Skip to content

Commit

Permalink
Merge pull request #1034 from custom-components/fix_temperature_convert
Browse files Browse the repository at this point in the history
Fix temperature convert
  • Loading branch information
Ernst79 authored Oct 6, 2022
2 parents 04c80d2 + 13e24d1 commit 86a7d9e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion custom_components/ble_monitor/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@
],
"dependencies": [],
"codeowners": ["@Ernst79", "@Magalex2x14", "@Thrilleratplay"],
"version": "10.5.0",
"version": "10.5.1",
"iot_class": "local_polling"
}
2 changes: 1 addition & 1 deletion custom_components/ble_monitor/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ async def async_added_to_hass(self):
if old_state.attributes["unit_of_measurement"] in [TEMP_CELSIUS, TEMP_FAHRENHEIT]:
# Convert old state temperature to a temperature in the device setting temperature unit
self._attr_native_unit_of_measurement = self._device_settings["temperature unit"]
self.state = TemperatureConverter.convert(
self._state = TemperatureConverter.convert(
value=float(old_state.state),
from_unit=old_state.attributes["unit_of_measurement"],
to_unit=self._device_settings["temperature unit"],
Expand Down

0 comments on commit 86a7d9e

Please sign in to comment.