mirror of
https://github.com/home-assistant/core.git
synced 2025-07-18 02:37:08 +00:00
Bump aioshelly library to 0.3.0 (#39716)
This commit is contained in:
parent
af47a94e70
commit
f29154011e
@ -37,13 +37,18 @@ async def async_setup(hass: HomeAssistant, config: dict):
|
|||||||
|
|
||||||
async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry):
|
async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry):
|
||||||
"""Set up Shelly from a config entry."""
|
"""Set up Shelly from a config entry."""
|
||||||
|
temperature_unit = "C" if hass.config.units.is_metric else "F"
|
||||||
|
options = aioshelly.ConnectionOptions(
|
||||||
|
entry.data[CONF_HOST],
|
||||||
|
entry.data.get(CONF_USERNAME),
|
||||||
|
entry.data.get(CONF_PASSWORD),
|
||||||
|
temperature_unit,
|
||||||
|
)
|
||||||
try:
|
try:
|
||||||
async with async_timeout.timeout(5):
|
async with async_timeout.timeout(5):
|
||||||
device = await aioshelly.Device.create(
|
device = await aioshelly.Device.create(
|
||||||
entry.data[CONF_HOST],
|
|
||||||
aiohttp_client.async_get_clientsession(hass),
|
aiohttp_client.async_get_clientsession(hass),
|
||||||
entry.data.get(CONF_USERNAME),
|
options,
|
||||||
entry.data.get(CONF_PASSWORD),
|
|
||||||
)
|
)
|
||||||
except (asyncio.TimeoutError, OSError) as err:
|
except (asyncio.TimeoutError, OSError) as err:
|
||||||
raise ConfigEntryNotReady from err
|
raise ConfigEntryNotReady from err
|
||||||
|
@ -25,12 +25,13 @@ async def validate_input(hass: core.HomeAssistant, host, data):
|
|||||||
|
|
||||||
Data has the keys from DATA_SCHEMA with values provided by the user.
|
Data has the keys from DATA_SCHEMA with values provided by the user.
|
||||||
"""
|
"""
|
||||||
|
options = aioshelly.ConnectionOptions(
|
||||||
|
host, data.get(CONF_USERNAME), data.get(CONF_PASSWORD)
|
||||||
|
)
|
||||||
async with async_timeout.timeout(5):
|
async with async_timeout.timeout(5):
|
||||||
device = await aioshelly.Device.create(
|
device = await aioshelly.Device.create(
|
||||||
host,
|
|
||||||
aiohttp_client.async_get_clientsession(hass),
|
aiohttp_client.async_get_clientsession(hass),
|
||||||
data.get(CONF_USERNAME),
|
options,
|
||||||
data.get(CONF_PASSWORD),
|
|
||||||
)
|
)
|
||||||
|
|
||||||
await device.shutdown()
|
await device.shutdown()
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
"name": "Shelly",
|
"name": "Shelly",
|
||||||
"config_flow": true,
|
"config_flow": true,
|
||||||
"documentation": "https://www.home-assistant.io/integrations/shelly2",
|
"documentation": "https://www.home-assistant.io/integrations/shelly2",
|
||||||
"requirements": ["aioshelly==0.2.1"],
|
"requirements": ["aioshelly==0.3.0"],
|
||||||
"zeroconf": ["_http._tcp.local."],
|
"zeroconf": ["_http._tcp.local."],
|
||||||
"codeowners": ["@balloob", "@bieniu"]
|
"codeowners": ["@balloob", "@bieniu"]
|
||||||
}
|
}
|
||||||
|
@ -221,7 +221,7 @@ aiopvpc==2.0.2
|
|||||||
aiopylgtv==0.3.3
|
aiopylgtv==0.3.3
|
||||||
|
|
||||||
# homeassistant.components.shelly
|
# homeassistant.components.shelly
|
||||||
aioshelly==0.2.1
|
aioshelly==0.3.0
|
||||||
|
|
||||||
# homeassistant.components.switcher_kis
|
# homeassistant.components.switcher_kis
|
||||||
aioswitcher==1.2.1
|
aioswitcher==1.2.1
|
||||||
|
@ -131,7 +131,7 @@ aiopvpc==2.0.2
|
|||||||
aiopylgtv==0.3.3
|
aiopylgtv==0.3.3
|
||||||
|
|
||||||
# homeassistant.components.shelly
|
# homeassistant.components.shelly
|
||||||
aioshelly==0.2.1
|
aioshelly==0.3.0
|
||||||
|
|
||||||
# homeassistant.components.switcher_kis
|
# homeassistant.components.switcher_kis
|
||||||
aioswitcher==1.2.1
|
aioswitcher==1.2.1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user