mirror of
https://github.com/joBr99/nspanel-lovelace-ui.git
synced 2025-12-20 14:37:01 +01:00
implement temp unit
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
# https://developers.home-assistant.io/docs/add-ons/configuration#add-on-config
|
# https://developers.home-assistant.io/docs/add-ons/configuration#add-on-config
|
||||||
name: NSPanel Lovelace UI Addon
|
name: NSPanel Lovelace UI Addon
|
||||||
version: "4.7.71"
|
version: "4.7.72"
|
||||||
slug: nspanel-lovelace-ui
|
slug: nspanel-lovelace-ui
|
||||||
description: NSPanel Lovelace UI Addon
|
description: NSPanel Lovelace UI Addon
|
||||||
services:
|
services:
|
||||||
|
|||||||
@@ -375,9 +375,8 @@ class ClimateCard(HACard):
|
|||||||
def render(self):
|
def render(self):
|
||||||
main_entity = self.entities[0]
|
main_entity = self.entities[0]
|
||||||
|
|
||||||
#TODO: temp unit
|
temp_unit = self.panel.temp_unit
|
||||||
temp_unit = "celsius"
|
if temp_unit == "celsius":
|
||||||
if(temp_unit == "celsius"):
|
|
||||||
temperature_unit_icon = get_icon_char("temperature-celsius")
|
temperature_unit_icon = get_icon_char("temperature-celsius")
|
||||||
temperature_unit = "°C"
|
temperature_unit = "°C"
|
||||||
|
|
||||||
@@ -411,7 +410,12 @@ class ClimateCard(HACard):
|
|||||||
|
|
||||||
min_temp = int(main_entity.attributes.get("min_temp", 0)*10)
|
min_temp = int(main_entity.attributes.get("min_temp", 0)*10)
|
||||||
max_temp = int(main_entity.attributes.get("max_temp", 0)*10)
|
max_temp = int(main_entity.attributes.get("max_temp", 0)*10)
|
||||||
step_temp = int(main_entity.attributes.get("target_temp_step", 0.5)*10)
|
|
||||||
|
if temp_unit == "celsius":
|
||||||
|
step_default = 0.5
|
||||||
|
else:
|
||||||
|
step_default = 0.5
|
||||||
|
step_temp = int(main_entity.attributes.get("target_temp_step", step_default)*10)
|
||||||
icon_res_list = []
|
icon_res_list = []
|
||||||
icon_res = ""
|
icon_res = ""
|
||||||
|
|
||||||
|
|||||||
@@ -20,6 +20,8 @@ class LovelaceUIPanel:
|
|||||||
self.recvTopic = self.settings["panelRecvTopic"]
|
self.recvTopic = self.settings["panelRecvTopic"]
|
||||||
self.model = self.settings.get("model", "eu")
|
self.model = self.settings.get("model", "eu")
|
||||||
|
|
||||||
|
self.temp_unit = self.settings("temp_unit", "celsius")
|
||||||
|
|
||||||
self.current_card = None
|
self.current_card = None
|
||||||
self.privious_cards = []
|
self.privious_cards = []
|
||||||
self.cards = {}
|
self.cards = {}
|
||||||
|
|||||||
Reference in New Issue
Block a user