diff --git a/custom_components/spaclient/spaclient.py b/custom_components/spaclient/spaclient.py index 7d8d1eb..da77293 100644 --- a/custom_components/spaclient/spaclient.py +++ b/custom_components/spaclient/spaclient.py @@ -6,7 +6,7 @@ # Import the device class from the component that you want to support from .const import _LOGGER from homeassistant.const import TEMP_CELSIUS, TEMP_FAHRENHEIT -from homeassistant.util.temperature import convert as convert_temperature +from homeassistant.util.unit_conversion import TemperatureConverter from threading import Lock @@ -730,7 +730,7 @@ def send_toggle_message(self, item): async def set_temperature(self, temp): if self.temp_scale == "Celsius": - temp = round(convert_temperature(temp, TEMP_FAHRENHEIT, TEMP_CELSIUS) * 2) + temp = round(TemperatureConverter.convert(temp, TEMP_FAHRENHEIT, TEMP_CELSIUS) * 2) self.send_message(b'\x0a\xbf\x20', bytes([int(temp)])) async def set_current_time(self): diff --git a/custom_components/spaclient/translations/nb.json b/custom_components/spaclient/translations/nb.json new file mode 100644 index 0000000..fcd3f34 --- /dev/null +++ b/custom_components/spaclient/translations/nb.json @@ -0,0 +1,29 @@ +{ + "config": { + "abort": { + "already_configured": "Enheten er allerede konfigurert" + }, + "error": { + "cannot_connect": "Kunne ikke koble til, vennligst prøv igjen", + "unknown": "Ukjent feil" + }, + "step": { + "user": { + "data": { + "host": "Vert", + "name": "Navn" + } + } + } + }, + "options": { + "step": { + "init": { + "data": { + "scan_interval": "Avstemningsfrekvens for verdier (sekunder)", + "sync_time": "Hold Balboa BP kontrollerens tid synkronisert med Home Assistant" + } + } + } + } +}