mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 03:07:37 +00:00
Bump linear-garage-door to 0.2.9 (#110298)
This commit is contained in:
parent
1f1042c034
commit
35149a46fc
@ -6,11 +6,12 @@ import logging
|
|||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
from linear_garage_door import Linear
|
from linear_garage_door import Linear
|
||||||
from linear_garage_door.errors import InvalidLoginError, ResponseError
|
from linear_garage_door.errors import InvalidLoginError
|
||||||
|
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.exceptions import ConfigEntryAuthFailed, ConfigEntryNotReady
|
from homeassistant.exceptions import ConfigEntryAuthFailed, ConfigEntryNotReady
|
||||||
|
from homeassistant.helpers.aiohttp_client import async_get_clientsession
|
||||||
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator
|
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
@ -55,6 +56,7 @@ class LinearUpdateCoordinator(DataUpdateCoordinator[dict[str, Any]]):
|
|||||||
email=self._email,
|
email=self._email,
|
||||||
password=self._password,
|
password=self._password,
|
||||||
device_id=self._device_id,
|
device_id=self._device_id,
|
||||||
|
client_session=async_get_clientsession(self.hass),
|
||||||
)
|
)
|
||||||
except InvalidLoginError as err:
|
except InvalidLoginError as err:
|
||||||
if (
|
if (
|
||||||
@ -63,8 +65,6 @@ class LinearUpdateCoordinator(DataUpdateCoordinator[dict[str, Any]]):
|
|||||||
):
|
):
|
||||||
raise ConfigEntryAuthFailed from err
|
raise ConfigEntryAuthFailed from err
|
||||||
raise ConfigEntryNotReady from err
|
raise ConfigEntryNotReady from err
|
||||||
except ResponseError as err:
|
|
||||||
raise ConfigEntryNotReady from err
|
|
||||||
|
|
||||||
if not self._devices:
|
if not self._devices:
|
||||||
self._devices = await linear.get_devices(self._site_id)
|
self._devices = await linear.get_devices(self._site_id)
|
||||||
|
@ -5,5 +5,5 @@
|
|||||||
"config_flow": true,
|
"config_flow": true,
|
||||||
"documentation": "https://www.home-assistant.io/integrations/linear_garage_door",
|
"documentation": "https://www.home-assistant.io/integrations/linear_garage_door",
|
||||||
"iot_class": "cloud_polling",
|
"iot_class": "cloud_polling",
|
||||||
"requirements": ["linear-garage-door==0.2.7"]
|
"requirements": ["linear-garage-door==0.2.9"]
|
||||||
}
|
}
|
||||||
|
@ -1232,7 +1232,7 @@ lightwave==0.24
|
|||||||
limitlessled==1.1.3
|
limitlessled==1.1.3
|
||||||
|
|
||||||
# homeassistant.components.linear_garage_door
|
# homeassistant.components.linear_garage_door
|
||||||
linear-garage-door==0.2.7
|
linear-garage-door==0.2.9
|
||||||
|
|
||||||
# homeassistant.components.linode
|
# homeassistant.components.linode
|
||||||
linode-api==4.1.9b1
|
linode-api==4.1.9b1
|
||||||
|
@ -983,7 +983,7 @@ librouteros==3.2.0
|
|||||||
libsoundtouch==0.8
|
libsoundtouch==0.8
|
||||||
|
|
||||||
# homeassistant.components.linear_garage_door
|
# homeassistant.components.linear_garage_door
|
||||||
linear-garage-door==0.2.7
|
linear-garage-door==0.2.9
|
||||||
|
|
||||||
# homeassistant.components.lamarzocco
|
# homeassistant.components.lamarzocco
|
||||||
lmcloud==0.4.35
|
lmcloud==0.4.35
|
||||||
|
@ -65,9 +65,13 @@ async def test_form(hass: HomeAssistant) -> None:
|
|||||||
async def test_reauth(hass: HomeAssistant) -> None:
|
async def test_reauth(hass: HomeAssistant) -> None:
|
||||||
"""Test reauthentication."""
|
"""Test reauthentication."""
|
||||||
|
|
||||||
|
with patch(
|
||||||
|
"homeassistant.components.linear_garage_door.async_setup_entry",
|
||||||
|
return_value=True,
|
||||||
|
):
|
||||||
entry = await async_init_integration(hass)
|
entry = await async_init_integration(hass)
|
||||||
|
|
||||||
result = await hass.config_entries.flow.async_init(
|
result1 = await hass.config_entries.flow.async_init(
|
||||||
DOMAIN,
|
DOMAIN,
|
||||||
context={
|
context={
|
||||||
"source": config_entries.SOURCE_REAUTH,
|
"source": config_entries.SOURCE_REAUTH,
|
||||||
@ -77,8 +81,8 @@ async def test_reauth(hass: HomeAssistant) -> None:
|
|||||||
},
|
},
|
||||||
data=entry.data,
|
data=entry.data,
|
||||||
)
|
)
|
||||||
assert result["type"] == FlowResultType.FORM
|
assert result1["type"] == FlowResultType.FORM
|
||||||
assert result["step_id"] == "user"
|
assert result1["step_id"] == "user"
|
||||||
|
|
||||||
with patch(
|
with patch(
|
||||||
"homeassistant.components.linear_garage_door.config_flow.Linear.login",
|
"homeassistant.components.linear_garage_door.config_flow.Linear.login",
|
||||||
@ -94,7 +98,7 @@ async def test_reauth(hass: HomeAssistant) -> None:
|
|||||||
return_value="test-uuid",
|
return_value="test-uuid",
|
||||||
):
|
):
|
||||||
result2 = await hass.config_entries.flow.async_configure(
|
result2 = await hass.config_entries.flow.async_configure(
|
||||||
result["flow_id"],
|
result1["flow_id"],
|
||||||
{
|
{
|
||||||
"email": "new-email",
|
"email": "new-email",
|
||||||
"password": "new-password",
|
"password": "new-password",
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
from unittest.mock import patch
|
from unittest.mock import patch
|
||||||
|
|
||||||
from linear_garage_door.errors import InvalidLoginError, ResponseError
|
from linear_garage_door.errors import InvalidLoginError
|
||||||
|
|
||||||
from homeassistant.components.linear_garage_door.const import DOMAIN
|
from homeassistant.components.linear_garage_door.const import DOMAIN
|
||||||
from homeassistant.config_entries import ConfigEntryState
|
from homeassistant.config_entries import ConfigEntryState
|
||||||
@ -45,32 +45,6 @@ async def test_invalid_password(
|
|||||||
assert flows[0]["context"]["source"] == "reauth"
|
assert flows[0]["context"]["source"] == "reauth"
|
||||||
|
|
||||||
|
|
||||||
async def test_response_error(hass: HomeAssistant) -> None:
|
|
||||||
"""Test response error."""
|
|
||||||
config_entry = MockConfigEntry(
|
|
||||||
domain=DOMAIN,
|
|
||||||
data={
|
|
||||||
"email": "test-email",
|
|
||||||
"password": "test-password",
|
|
||||||
"site_id": "test-site-id",
|
|
||||||
"device_id": "test-uuid",
|
|
||||||
},
|
|
||||||
)
|
|
||||||
config_entry.add_to_hass(hass)
|
|
||||||
|
|
||||||
with patch(
|
|
||||||
"homeassistant.components.linear_garage_door.coordinator.Linear.login",
|
|
||||||
side_effect=ResponseError,
|
|
||||||
):
|
|
||||||
assert not await hass.config_entries.async_setup(config_entry.entry_id)
|
|
||||||
await hass.async_block_till_done()
|
|
||||||
|
|
||||||
entries = hass.config_entries.async_entries(DOMAIN)
|
|
||||||
assert entries
|
|
||||||
assert len(entries) == 1
|
|
||||||
assert entries[0].state == ConfigEntryState.SETUP_RETRY
|
|
||||||
|
|
||||||
|
|
||||||
async def test_invalid_login(
|
async def test_invalid_login(
|
||||||
hass: HomeAssistant,
|
hass: HomeAssistant,
|
||||||
) -> None:
|
) -> None:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user