Skip to content

Commit 5b490e6

Browse files
committed
Made translations UTF8 coded incl degree Celsius (°C) sign
ThermIQ_Card updated to use binary_sensor for EVU Updates to database conversion
1 parent 0189234 commit 5b490e6

4 files changed

Lines changed: 171 additions & 167 deletions

File tree

ThermIQ_Card.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ entities:
5454
<ha-icon icon="mdi:fan" id="hpwidget-BRINESPIN" style="position:absolute;top:126px;left:11px;z-index:2;{% if (states('binary_sensor.thermiq_mqtt_vp1_brine_pump_on')=='on') %}animation: rotating 2s linear infinite;{% endif %}"></ha-icon>
5555
<ha-icon icon="mdi:fan" id="hpwidget-CIRKPSPIN" style="position:absolute;top:228px;left:147px;z-index:2;{% if (states('binary_sensor.thermiq_mqtt_vp1_supply_pump_on')=='on') %}animation: rotating 2s linear infinite;{% endif %}"></ha-icon>
5656
<ha-icon icon="mdi:alert-circle" id="hpwidget-ALERT" style="color:red;position:absolute;top:42px;left:82px;z-index:4;animation: blink 1s steps(5, start) infinite;{% if (states('sensor.thermiq_mqtt_vp1_communication_status')=='Ok') %}display:none{% endif %}"></ha-icon>
57-
<ha-icon icon="mdi:stop" id="hpwidget-EVU" style="color:red;position:absolute;top:62px;left:82px;z-index:3;animation: blink 1s steps(5, start) infinite;{% if (states('sensor.thermiq_mqtt_vp1_heatpump_evu_block') | int ==1) %} {% else %}display:none{% endif %}">EVU</ha-icon>
57+
<ha-icon icon="mdi:stop" id="hpwidget-EVU" style="color:red;position:absolute;top:62px;left:82px;z-index:3;animation: blink 1s steps(5, start) infinite;{% if (states('sensor.thermiq_mqtt_vp1_heatpump_evu_block')=='on') %} {% else %}display:none{% endif %}">EVU</ha-icon>
5858
</div>
5959
<div class="hpwidget-vald" title="Indoor Temperature" style="position:absolute;top:70px;left: 24px;z-index:2;><span class="hpwidget-name-span" id="hpwidget-INDR_T"></span>{{ states('sensor.thermiq_mqtt_vp1_indoor_t') }}<span class="hpwidget-unit-spand">&deg;C</span></div>
6060
<div class="hpwidget-vald" title="Indoor Temperature" style="position:absolute;top:20px;left:24px;z-index:2;><span class="hpwidget-name-span" id="hpwidget-OUTDOOR_T"></span>{{ states('sensor.thermiq_mqtt_vp1_outdoor_t') }}<span class="hpwidget-unit-spand">&deg;C</span></div>
@@ -116,7 +116,7 @@ entities:
116116
# Room sensor only works together with Thermiq-Room ##################################################################
117117
- type: custom:numberbox-card
118118
entity: input_number.thermiq_mqtt_vp1_room_sensor_set_t
119-
- entity: input_number.thermiq_mqtt_vp1_heatpump_evu_block
119+
- entity: input_boolean.thermiq_mqtt_vp1_heatpump_evu_block
120120
# Energy management only works with Thermiq-Room2 and AIO Energy Management HACS plugin ##################################################################
121121
- type: custom:fold-entity-row
122122
head:

custom_components/thermiq_mqtt/__init__.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
"""Component for ThermIQ-MQTT support."""
22
import logging
33
from builtins import property
4+
from datetime import datetime
5+
from sqlalchemy import update, select
46

57
from homeassistant.config_entries import ConfigEntry
68
from homeassistant.core import HomeAssistant, Event
79
from homeassistant.const import EVENT_HOMEASSISTANT_STARTED
8-
from homeassistant.components.recorder import get_instance as recorder_get_instance
9-
from homeassistant.helpers.recorder import session_scope
10+
11+
from homeassistant.helpers.recorder import session_scope, get_instance as recorder_get_instance
1012
from homeassistant.helpers import entity_registry as er
13+
from homeassistant.components.recorder.db_schema import StatisticsMeta
1114

1215
from .const import (
1316
DOMAIN,
@@ -155,8 +158,6 @@ async def _migrate_statistics_metadata(hass: HomeAssistant, recorder, entity_id:
155158

156159
def _update_metadata(session):
157160
"""Update metadata within a database session."""
158-
from sqlalchemy import update, select
159-
from homeassistant.components.recorder.db_schema import StatisticsMeta
160161

161162
try:
162163
# First check if metadata exists
@@ -187,6 +188,9 @@ def _update_metadata(session):
187188
)
188189

189190
result = session.execute(update_stmt)
191+
# Suggest to replace with but this is alread doen.
192+
#homeassistant.components.recorder.get_instance(hass).async_add_executor_job()
193+
190194

191195
if result.rowcount > 0:
192196
_LOGGER.debug("Updated statistics metadata for %s", entity_id)

0 commit comments

Comments
 (0)