mirror of
https://github.com/home-assistant/core.git
synced 2025-07-16 01:37:08 +00:00
Fix for schluter unit system bug (#34230)
This commit is contained in:
parent
f516b24dfb
commit
f3b702db5a
@ -7,6 +7,7 @@ import voluptuous as vol
|
|||||||
from homeassistant.components.climate import (
|
from homeassistant.components.climate import (
|
||||||
PLATFORM_SCHEMA,
|
PLATFORM_SCHEMA,
|
||||||
SCAN_INTERVAL,
|
SCAN_INTERVAL,
|
||||||
|
TEMP_CELSIUS,
|
||||||
ClimateDevice,
|
ClimateDevice,
|
||||||
)
|
)
|
||||||
from homeassistant.components.climate.const import (
|
from homeassistant.components.climate.const import (
|
||||||
@ -32,7 +33,6 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info=
|
|||||||
return
|
return
|
||||||
session_id = hass.data[DOMAIN][DATA_SCHLUTER_SESSION]
|
session_id = hass.data[DOMAIN][DATA_SCHLUTER_SESSION]
|
||||||
api = hass.data[DOMAIN][DATA_SCHLUTER_API]
|
api = hass.data[DOMAIN][DATA_SCHLUTER_API]
|
||||||
temp_unit = hass.config.units.temperature_unit
|
|
||||||
|
|
||||||
async def async_update_data():
|
async def async_update_data():
|
||||||
try:
|
try:
|
||||||
@ -58,7 +58,7 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info=
|
|||||||
await coordinator.async_refresh()
|
await coordinator.async_refresh()
|
||||||
|
|
||||||
async_add_entities(
|
async_add_entities(
|
||||||
SchluterThermostat(coordinator, serial_number, temp_unit, api, session_id)
|
SchluterThermostat(coordinator, serial_number, api, session_id)
|
||||||
for serial_number, thermostat in coordinator.data.items()
|
for serial_number, thermostat in coordinator.data.items()
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -66,9 +66,8 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info=
|
|||||||
class SchluterThermostat(ClimateDevice):
|
class SchluterThermostat(ClimateDevice):
|
||||||
"""Representation of a Schluter thermostat."""
|
"""Representation of a Schluter thermostat."""
|
||||||
|
|
||||||
def __init__(self, coordinator, serial_number, temp_unit, api, session_id):
|
def __init__(self, coordinator, serial_number, api, session_id):
|
||||||
"""Initialize the thermostat."""
|
"""Initialize the thermostat."""
|
||||||
self._unit = temp_unit
|
|
||||||
self._coordinator = coordinator
|
self._coordinator = coordinator
|
||||||
self._serial_number = serial_number
|
self._serial_number = serial_number
|
||||||
self._api = api
|
self._api = api
|
||||||
@ -102,8 +101,8 @@ class SchluterThermostat(ClimateDevice):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def temperature_unit(self):
|
def temperature_unit(self):
|
||||||
"""Return the unit of measurement."""
|
"""Schluter API always uses celsius."""
|
||||||
return self._unit
|
return TEMP_CELSIUS
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def current_temperature(self):
|
def current_temperature(self):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user