mirror of
https://github.com/home-assistant/core.git
synced 2025-07-14 16:57:10 +00:00
Bump airgradient to 0.7.1 removing mashumaro direct dependency (#122534)
This commit is contained in:
parent
0c7ab2062f
commit
e8eb1ed35c
@ -2,9 +2,13 @@
|
|||||||
|
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
from airgradient import AirGradientClient, AirGradientError, ConfigurationControl
|
from airgradient import (
|
||||||
|
AirGradientClient,
|
||||||
|
AirGradientError,
|
||||||
|
AirGradientParseError,
|
||||||
|
ConfigurationControl,
|
||||||
|
)
|
||||||
from awesomeversion import AwesomeVersion
|
from awesomeversion import AwesomeVersion
|
||||||
from mashumaro import MissingField
|
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
||||||
from homeassistant.components import zeroconf
|
from homeassistant.components import zeroconf
|
||||||
@ -83,10 +87,10 @@ class AirGradientConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
self.client = AirGradientClient(user_input[CONF_HOST], session=session)
|
self.client = AirGradientClient(user_input[CONF_HOST], session=session)
|
||||||
try:
|
try:
|
||||||
current_measures = await self.client.get_current_measures()
|
current_measures = await self.client.get_current_measures()
|
||||||
|
except AirGradientParseError:
|
||||||
|
return self.async_abort(reason="invalid_version")
|
||||||
except AirGradientError:
|
except AirGradientError:
|
||||||
errors["base"] = "cannot_connect"
|
errors["base"] = "cannot_connect"
|
||||||
except MissingField:
|
|
||||||
return self.async_abort(reason="invalid_version")
|
|
||||||
else:
|
else:
|
||||||
await self.async_set_unique_id(current_measures.serial_number)
|
await self.async_set_unique_id(current_measures.serial_number)
|
||||||
self._abort_if_unique_id_configured()
|
self._abort_if_unique_id_configured()
|
||||||
|
@ -6,6 +6,6 @@
|
|||||||
"documentation": "https://www.home-assistant.io/integrations/airgradient",
|
"documentation": "https://www.home-assistant.io/integrations/airgradient",
|
||||||
"integration_type": "device",
|
"integration_type": "device",
|
||||||
"iot_class": "local_polling",
|
"iot_class": "local_polling",
|
||||||
"requirements": ["airgradient==0.7.0"],
|
"requirements": ["airgradient==0.7.1"],
|
||||||
"zeroconf": ["_airgradient._tcp.local."]
|
"zeroconf": ["_airgradient._tcp.local."]
|
||||||
}
|
}
|
||||||
|
@ -410,7 +410,7 @@ aiowithings==3.0.2
|
|||||||
aioymaps==1.2.4
|
aioymaps==1.2.4
|
||||||
|
|
||||||
# homeassistant.components.airgradient
|
# homeassistant.components.airgradient
|
||||||
airgradient==0.7.0
|
airgradient==0.7.1
|
||||||
|
|
||||||
# homeassistant.components.airly
|
# homeassistant.components.airly
|
||||||
airly==1.1.0
|
airly==1.1.0
|
||||||
|
@ -389,7 +389,7 @@ aiowithings==3.0.2
|
|||||||
aioymaps==1.2.4
|
aioymaps==1.2.4
|
||||||
|
|
||||||
# homeassistant.components.airgradient
|
# homeassistant.components.airgradient
|
||||||
airgradient==0.7.0
|
airgradient==0.7.1
|
||||||
|
|
||||||
# homeassistant.components.airly
|
# homeassistant.components.airly
|
||||||
airly==1.1.0
|
airly==1.1.0
|
||||||
|
@ -3,8 +3,11 @@
|
|||||||
from ipaddress import ip_address
|
from ipaddress import ip_address
|
||||||
from unittest.mock import AsyncMock
|
from unittest.mock import AsyncMock
|
||||||
|
|
||||||
from airgradient import AirGradientConnectionError, ConfigurationControl
|
from airgradient import (
|
||||||
from mashumaro import MissingField
|
AirGradientConnectionError,
|
||||||
|
AirGradientParseError,
|
||||||
|
ConfigurationControl,
|
||||||
|
)
|
||||||
|
|
||||||
from homeassistant.components.airgradient import DOMAIN
|
from homeassistant.components.airgradient import DOMAIN
|
||||||
from homeassistant.components.zeroconf import ZeroconfServiceInfo
|
from homeassistant.components.zeroconf import ZeroconfServiceInfo
|
||||||
@ -141,9 +144,7 @@ async def test_flow_old_firmware_version(
|
|||||||
mock_setup_entry: AsyncMock,
|
mock_setup_entry: AsyncMock,
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Test flow with old firmware version."""
|
"""Test flow with old firmware version."""
|
||||||
mock_airgradient_client.get_current_measures.side_effect = MissingField(
|
mock_airgradient_client.get_current_measures.side_effect = AirGradientParseError
|
||||||
"", object, object
|
|
||||||
)
|
|
||||||
|
|
||||||
result = await hass.config_entries.flow.async_init(
|
result = await hass.config_entries.flow.async_init(
|
||||||
DOMAIN,
|
DOMAIN,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user