mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 05:07:41 +00:00
Always use Celsius in Shelly integration (#80842)
This commit is contained in:
parent
ed2696f03e
commit
16beed2565
@ -16,7 +16,6 @@ from homeassistant.exceptions import ConfigEntryAuthFailed, ConfigEntryNotReady
|
|||||||
from homeassistant.helpers import aiohttp_client, device_registry
|
from homeassistant.helpers import aiohttp_client, device_registry
|
||||||
import homeassistant.helpers.config_validation as cv
|
import homeassistant.helpers.config_validation as cv
|
||||||
from homeassistant.helpers.typing import ConfigType
|
from homeassistant.helpers.typing import ConfigType
|
||||||
from homeassistant.util.unit_system import METRIC_SYSTEM
|
|
||||||
|
|
||||||
from .const import (
|
from .const import (
|
||||||
CONF_COAP_PORT,
|
CONF_COAP_PORT,
|
||||||
@ -113,13 +112,10 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
|||||||
|
|
||||||
async def _async_setup_block_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
async def _async_setup_block_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
||||||
"""Set up Shelly block based device from a config entry."""
|
"""Set up Shelly block based device from a config entry."""
|
||||||
temperature_unit = "C" if hass.config.units is METRIC_SYSTEM else "F"
|
|
||||||
|
|
||||||
options = aioshelly.common.ConnectionOptions(
|
options = aioshelly.common.ConnectionOptions(
|
||||||
entry.data[CONF_HOST],
|
entry.data[CONF_HOST],
|
||||||
entry.data.get(CONF_USERNAME),
|
entry.data.get(CONF_USERNAME),
|
||||||
entry.data.get(CONF_PASSWORD),
|
entry.data.get(CONF_PASSWORD),
|
||||||
temperature_unit,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
coap_context = await get_coap_context(hass)
|
coap_context = await get_coap_context(hass)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user