From 3a201682635588627a63984300acf5c2a52750aa Mon Sep 17 00:00:00 2001 From: dislabled Date: Thu, 26 Jan 2023 23:17:47 +0100 Subject: [PATCH 1/2] =?UTF-8?q?Added=20Norwegian=20Bokm=C3=A5l=20translati?= =?UTF-8?q?ons?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../spaclient/translations/nb.json | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 custom_components/spaclient/translations/nb.json 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" + } + } + } + } +} From 3c8574d976a7733379014f0467e1e8fa43c7f648 Mon Sep 17 00:00:00 2001 From: dislabled Date: Thu, 26 Jan 2023 23:19:33 +0100 Subject: [PATCH 2/2] Changed deprecated temperature utility to unit_conversion.Temperature --- custom_components/spaclient/spaclient.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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):