Compare commits

...

7 Commits

Author SHA1 Message Date
Franck Nijhof 2593dc507d Bumped version to 2021.5.0b3 2021-04-30 11:14:58 +02:00
Franck Nijhof 1e3d90ac0a Fix unexpected data in Google Travel Time config flow import (#49903) 2021-04-30 11:14:38 +02:00
Franck Nijhof 0ae392df75 Fix unexpected data in Waze config flow import (#49902) 2021-04-30 11:14:35 +02:00
Franck Nijhof cd3633c48f Update frontend to 20210429.0 (#49896) 2021-04-30 11:14:32 +02:00
Raman Gupta 83ff5bfa37 Don't validate inputs on platform setup for Google/Waze travel time (#49886)
* Don't validate inputs on platform setup for Google/Waze travel time

* feedback from other PR
2021-04-30 11:14:29 +02:00
Tom Toor aa46549be9 Reduced polling interval for mutesync integration (#49884) 2021-04-30 11:14:26 +02:00
Aaron Bach 41cf66c294 Remove no-longer-functioning SimpliSafe websocket support (#49876)
* Remove no-longer-functioning SimpliSafe websocket support

* Linting
2021-04-30 11:14:22 +02:00
10 changed files with 45 additions and 49 deletions
@@ -2,9 +2,7 @@
"domain": "frontend",
"name": "Home Assistant Frontend",
"documentation": "https://www.home-assistant.io/integrations/frontend",
"requirements": [
"home-assistant-frontend==20210407.1"
],
"requirements": ["home-assistant-frontend==20210429.0"],
"dependencies": [
"api",
"auth",
@@ -17,8 +15,6 @@
"system_log",
"websocket_api"
],
"codeowners": [
"@home-assistant/frontend"
],
"codeowners": ["@home-assistant/frontend"],
"quality_scale": "internal"
}
}
@@ -14,13 +14,14 @@ from homeassistant.config_entries import SOURCE_IMPORT, ConfigEntry
from homeassistant.const import (
ATTR_ATTRIBUTION,
CONF_API_KEY,
CONF_ENTITY_NAMESPACE,
CONF_MODE,
CONF_NAME,
CONF_SCAN_INTERVAL,
EVENT_HOMEASSISTANT_STARTED,
TIME_MINUTES,
)
from homeassistant.core import CoreState, HomeAssistant
from homeassistant.exceptions import ConfigEntryNotReady
import homeassistant.helpers.config_validation as cv
import homeassistant.util.dt as dt_util
@@ -40,6 +41,7 @@ from .const import (
CONF_TRANSIT_ROUTING_PREFERENCE,
CONF_TRAVEL_MODE,
CONF_UNITS,
DEFAULT_NAME,
DOMAIN,
TRACKABLE_DOMAINS,
TRANSIT_PREFS,
@@ -48,7 +50,7 @@ from .const import (
TRAVEL_MODEL,
UNITS,
)
from .helpers import get_location_from_entity, is_valid_config_entry, resolve_zone
from .helpers import get_location_from_entity, resolve_zone
_LOGGER = logging.getLogger(__name__)
@@ -79,7 +81,11 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
}
),
),
}
# Remove options to exclude from import
vol.Remove(CONF_ENTITY_NAMESPACE): cv.string,
vol.Remove(CONF_SCAN_INTERVAL): cv.time_period,
},
extra=vol.REMOVE_EXTRA,
)
@@ -126,12 +132,7 @@ async def async_setup_entry(
api_key = config_entry.data[CONF_API_KEY]
origin = config_entry.data[CONF_ORIGIN]
destination = config_entry.data[CONF_DESTINATION]
name = config_entry.data[CONF_NAME]
if not await hass.async_add_executor_job(
is_valid_config_entry, hass, _LOGGER, api_key, origin, destination
):
raise ConfigEntryNotReady
name = config_entry.data.get(CONF_NAME, DEFAULT_NAME)
client = Client(api_key, timeout=10)
@@ -26,7 +26,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
async def update_data():
"""Update the data."""
async with async_timeout.timeout(5):
async with async_timeout.timeout(2.5):
return await client.get_state()
coordinator = hass.data.setdefault(DOMAIN, {})[
@@ -35,7 +35,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
hass,
logging.getLogger(__name__),
name=DOMAIN,
update_interval=timedelta(seconds=10),
update_interval=timedelta(seconds=5),
update_method=update_data,
)
await coordinator.async_config_entry_first_refresh()
@@ -26,7 +26,7 @@ async def validate_input(hass: HomeAssistant, data: dict[str, Any]) -> dict[str,
"""
session = hass.helpers.aiohttp_client.async_get_clientsession()
try:
async with async_timeout.timeout(10):
async with async_timeout.timeout(5):
token = await mutesync.authenticate(session, data["host"])
except aiohttp.ClientResponseError as error:
if error.status == 403:
+14 -16
View File
@@ -17,13 +17,7 @@ from simplipy.websocket import (
)
import voluptuous as vol
from homeassistant.const import (
ATTR_CODE,
CONF_CODE,
CONF_TOKEN,
CONF_USERNAME,
EVENT_HOMEASSISTANT_STOP,
)
from homeassistant.const import ATTR_CODE, CONF_CODE, CONF_TOKEN, CONF_USERNAME
from homeassistant.core import CoreState, callback
from homeassistant.exceptions import ConfigEntryAuthFailed, ConfigEntryNotReady
from homeassistant.helpers import (
@@ -454,17 +448,21 @@ class SimpliSafe:
async def async_init(self):
"""Initialize the data class."""
asyncio.create_task(self.websocket.async_connect())
# 2021-04-29: Disabling connection to the websocket due to the SimpliSafe cloud
# removing it (and not providing a clear alternative).
# asyncio.create_task(self.websocket.async_connect())
async def async_websocket_disconnect(_):
"""Define an event handler to disconnect from the websocket."""
await self.websocket.async_disconnect()
# async def async_websocket_disconnect(_):
# """Define an event handler to disconnect from the websocket."""
# await self.websocket.async_disconnect()
self._hass.data[DOMAIN][DATA_LISTENER][self.config_entry.entry_id].append(
self._hass.bus.async_listen_once(
EVENT_HOMEASSISTANT_STOP, async_websocket_disconnect
)
)
# 2021-04-29: Disabling disconnection from the websocket due to the SimpliSafe
# cloud removing it (and not providing a clear alternative).
# self._hass.data[DOMAIN][DATA_LISTENER][self.config_entry.entry_id].append(
# self._hass.bus.async_listen_once(
# EVENT_HOMEASSISTANT_STOP, async_websocket_disconnect
# )
# )
self.systems = await self._api.get_systems()
for system in self.systems.values():
@@ -13,14 +13,15 @@ from homeassistant.components.sensor import PLATFORM_SCHEMA, SensorEntity
from homeassistant.config_entries import SOURCE_IMPORT, ConfigEntry
from homeassistant.const import (
ATTR_ATTRIBUTION,
CONF_ENTITY_NAMESPACE,
CONF_NAME,
CONF_REGION,
CONF_SCAN_INTERVAL,
CONF_UNIT_SYSTEM_IMPERIAL,
EVENT_HOMEASSISTANT_STARTED,
TIME_MINUTES,
)
from homeassistant.core import Config, CoreState, HomeAssistant
from homeassistant.exceptions import ConfigEntryNotReady
import homeassistant.helpers.config_validation as cv
from .const import (
@@ -43,6 +44,7 @@ from .const import (
DEFAULT_AVOID_FERRIES,
DEFAULT_AVOID_SUBSCRIPTION_ROADS,
DEFAULT_AVOID_TOLL_ROADS,
DEFAULT_NAME,
DEFAULT_REALTIME,
DEFAULT_VEHICLE_TYPE,
DOMAIN,
@@ -52,7 +54,7 @@ from .const import (
UNITS,
VEHICLE_TYPES,
)
from .helpers import get_location_from_entity, is_valid_config_entry, resolve_zone
from .helpers import get_location_from_entity, resolve_zone
_LOGGER = logging.getLogger(__name__)
@@ -78,7 +80,11 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
CONF_AVOID_SUBSCRIPTION_ROADS, default=DEFAULT_AVOID_SUBSCRIPTION_ROADS
): cv.boolean,
vol.Optional(CONF_AVOID_FERRIES, default=DEFAULT_AVOID_FERRIES): cv.boolean,
}
# Remove options to exclude from import
vol.Remove(CONF_ENTITY_NAMESPACE): cv.string,
vol.Remove(CONF_SCAN_INTERVAL): cv.time_period,
},
extra=vol.REMOVE_EXTRA,
)
@@ -142,12 +148,7 @@ async def async_setup_entry(
destination = config_entry.data[CONF_DESTINATION]
origin = config_entry.data[CONF_ORIGIN]
region = config_entry.data[CONF_REGION]
name = config_entry.data[CONF_NAME]
if not await hass.async_add_executor_job(
is_valid_config_entry, hass, _LOGGER, origin, destination, region
):
raise ConfigEntryNotReady
name = config_entry.data.get(CONF_NAME, DEFAULT_NAME)
data = WazeTravelTimeData(
None,
@@ -331,7 +332,7 @@ class WazeTravelTimeData:
if excl_filter.lower() not in k.lower()
}
if len(routes) > 0:
if routes:
route = list(routes)[0]
else:
_LOGGER.warning("No routes found")
+1 -1
View File
@@ -1,7 +1,7 @@
"""Constants used by Home Assistant components."""
MAJOR_VERSION = 2021
MINOR_VERSION = 5
PATCH_VERSION = "0b2"
PATCH_VERSION = "0b3"
__short_version__ = f"{MAJOR_VERSION}.{MINOR_VERSION}"
__version__ = f"{__short_version__}.{PATCH_VERSION}"
REQUIRED_PYTHON_VER = (3, 8, 0)
+1 -1
View File
@@ -16,7 +16,7 @@ defusedxml==0.6.0
distro==1.5.0
emoji==1.2.0
hass-nabucasa==0.43.0
home-assistant-frontend==20210407.1
home-assistant-frontend==20210429.0
httpx==0.18.0
jinja2>=2.11.3
netdisco==2.8.2
+1 -1
View File
@@ -762,7 +762,7 @@ hole==0.5.1
holidays==0.11.1
# homeassistant.components.frontend
home-assistant-frontend==20210407.1
home-assistant-frontend==20210429.0
# homeassistant.components.zwave
homeassistant-pyozw==0.1.10
+1 -1
View File
@@ -423,7 +423,7 @@ hole==0.5.1
holidays==0.11.1
# homeassistant.components.frontend
home-assistant-frontend==20210407.1
home-assistant-frontend==20210429.0
# homeassistant.components.zwave
homeassistant-pyozw==0.1.10