mirror of
https://github.com/home-assistant/core.git
synced 2025-07-24 21:57:51 +00:00
commit
76d2658101
@ -5,7 +5,6 @@ from typing import Any, Awaitable, Callable, List, Optional, Set
|
|||||||
|
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
||||||
from homeassistant.components import sun
|
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
ATTR_ENTITY_ID,
|
ATTR_ENTITY_ID,
|
||||||
ATTR_NAME,
|
ATTR_NAME,
|
||||||
@ -578,6 +577,6 @@ def _trigger_extract_entities(trigger_conf: dict) -> List[str]:
|
|||||||
return [trigger_conf[CONF_ZONE]]
|
return [trigger_conf[CONF_ZONE]]
|
||||||
|
|
||||||
if trigger_conf[CONF_PLATFORM] == "sun":
|
if trigger_conf[CONF_PLATFORM] == "sun":
|
||||||
return [sun.ENTITY_ID]
|
return ["sun.sun"]
|
||||||
|
|
||||||
return []
|
return []
|
||||||
|
@ -27,7 +27,7 @@ GARMIN_ENTITY_LIST = {
|
|||||||
False,
|
False,
|
||||||
],
|
],
|
||||||
"netCalorieGoal": ["Net Calorie Goal", "cal", "mdi:food", None, False],
|
"netCalorieGoal": ["Net Calorie Goal", "cal", "mdi:food", None, False],
|
||||||
"totalDistanceMeters": ["Total Distance Mtr", "mtr", "mdi:walk", None, True],
|
"totalDistanceMeters": ["Total Distance Mtr", "m", "mdi:walk", None, True],
|
||||||
"wellnessStartTimeLocal": [
|
"wellnessStartTimeLocal": [
|
||||||
"Wellness Start Time",
|
"Wellness Start Time",
|
||||||
"",
|
"",
|
||||||
@ -43,7 +43,7 @@ GARMIN_ENTITY_LIST = {
|
|||||||
False,
|
False,
|
||||||
],
|
],
|
||||||
"wellnessDescription": ["Wellness Description", "", "mdi:clock", None, False],
|
"wellnessDescription": ["Wellness Description", "", "mdi:clock", None, False],
|
||||||
"wellnessDistanceMeters": ["Wellness Distance Mtr", "mtr", "mdi:walk", None, False],
|
"wellnessDistanceMeters": ["Wellness Distance Mtr", "m", "mdi:walk", None, False],
|
||||||
"wellnessActiveKilocalories": [
|
"wellnessActiveKilocalories": [
|
||||||
"Wellness Active KiloCalories",
|
"Wellness Active KiloCalories",
|
||||||
"kcal",
|
"kcal",
|
||||||
@ -52,16 +52,16 @@ GARMIN_ENTITY_LIST = {
|
|||||||
False,
|
False,
|
||||||
],
|
],
|
||||||
"wellnessKilocalories": ["Wellness KiloCalories", "kcal", "mdi:food", None, False],
|
"wellnessKilocalories": ["Wellness KiloCalories", "kcal", "mdi:food", None, False],
|
||||||
"highlyActiveSeconds": ["Highly Active Time", "minutes", "mdi:fire", None, False],
|
"highlyActiveSeconds": ["Highly Active Time", "min", "mdi:fire", None, False],
|
||||||
"activeSeconds": ["Active Time", "minutes", "mdi:fire", None, True],
|
"activeSeconds": ["Active Time", "min", "mdi:fire", None, True],
|
||||||
"sedentarySeconds": ["Sedentary Time", "minutes", "mdi:seat", None, True],
|
"sedentarySeconds": ["Sedentary Time", "min", "mdi:seat", None, True],
|
||||||
"sleepingSeconds": ["Sleeping Time", "minutes", "mdi:sleep", None, True],
|
"sleepingSeconds": ["Sleeping Time", "min", "mdi:sleep", None, True],
|
||||||
"measurableAwakeDuration": ["Awake Duration", "minutes", "mdi:sleep", None, True],
|
"measurableAwakeDuration": ["Awake Duration", "min", "mdi:sleep", None, True],
|
||||||
"measurableAsleepDuration": ["Sleep Duration", "minutes", "mdi:sleep", None, True],
|
"measurableAsleepDuration": ["Sleep Duration", "min", "mdi:sleep", None, True],
|
||||||
"floorsAscendedInMeters": ["Floors Ascended Mtr", "mtr", "mdi:stairs", None, False],
|
"floorsAscendedInMeters": ["Floors Ascended Mtr", "m", "mdi:stairs", None, False],
|
||||||
"floorsDescendedInMeters": [
|
"floorsDescendedInMeters": [
|
||||||
"Floors Descended Mtr",
|
"Floors Descended Mtr",
|
||||||
"mtr",
|
"m",
|
||||||
"mdi:stairs",
|
"mdi:stairs",
|
||||||
None,
|
None,
|
||||||
False,
|
False,
|
||||||
@ -97,52 +97,46 @@ GARMIN_ENTITY_LIST = {
|
|||||||
"averageStressLevel": ["Avg Stress Level", "", "mdi:flash-alert", None, True],
|
"averageStressLevel": ["Avg Stress Level", "", "mdi:flash-alert", None, True],
|
||||||
"maxStressLevel": ["Max Stress Level", "", "mdi:flash-alert", None, True],
|
"maxStressLevel": ["Max Stress Level", "", "mdi:flash-alert", None, True],
|
||||||
"stressQualifier": ["Stress Qualifier", "", "mdi:flash-alert", None, False],
|
"stressQualifier": ["Stress Qualifier", "", "mdi:flash-alert", None, False],
|
||||||
"stressDuration": ["Stress Duration", "minutes", "mdi:flash-alert", None, False],
|
"stressDuration": ["Stress Duration", "min", "mdi:flash-alert", None, False],
|
||||||
"restStressDuration": [
|
"restStressDuration": [
|
||||||
"Rest Stress Duration",
|
"Rest Stress Duration",
|
||||||
"minutes",
|
"min",
|
||||||
"mdi:flash-alert",
|
"mdi:flash-alert",
|
||||||
None,
|
None,
|
||||||
True,
|
True,
|
||||||
],
|
],
|
||||||
"activityStressDuration": [
|
"activityStressDuration": [
|
||||||
"Activity Stress Duration",
|
"Activity Stress Duration",
|
||||||
"minutes",
|
"min",
|
||||||
"mdi:flash-alert",
|
"mdi:flash-alert",
|
||||||
None,
|
None,
|
||||||
True,
|
True,
|
||||||
],
|
],
|
||||||
"uncategorizedStressDuration": [
|
"uncategorizedStressDuration": [
|
||||||
"Uncat. Stress Duration",
|
"Uncat. Stress Duration",
|
||||||
"minutes",
|
"min",
|
||||||
"mdi:flash-alert",
|
"mdi:flash-alert",
|
||||||
None,
|
None,
|
||||||
True,
|
True,
|
||||||
],
|
],
|
||||||
"totalStressDuration": [
|
"totalStressDuration": [
|
||||||
"Total Stress Duration",
|
"Total Stress Duration",
|
||||||
"minutes",
|
"min",
|
||||||
"mdi:flash-alert",
|
|
||||||
None,
|
|
||||||
True,
|
|
||||||
],
|
|
||||||
"lowStressDuration": [
|
|
||||||
"Low Stress Duration",
|
|
||||||
"minutes",
|
|
||||||
"mdi:flash-alert",
|
"mdi:flash-alert",
|
||||||
None,
|
None,
|
||||||
True,
|
True,
|
||||||
],
|
],
|
||||||
|
"lowStressDuration": ["Low Stress Duration", "min", "mdi:flash-alert", None, True],
|
||||||
"mediumStressDuration": [
|
"mediumStressDuration": [
|
||||||
"Medium Stress Duration",
|
"Medium Stress Duration",
|
||||||
"minutes",
|
"min",
|
||||||
"mdi:flash-alert",
|
"mdi:flash-alert",
|
||||||
None,
|
None,
|
||||||
True,
|
True,
|
||||||
],
|
],
|
||||||
"highStressDuration": [
|
"highStressDuration": [
|
||||||
"High Stress Duration",
|
"High Stress Duration",
|
||||||
"minutes",
|
"min",
|
||||||
"mdi:flash-alert",
|
"mdi:flash-alert",
|
||||||
None,
|
None,
|
||||||
True,
|
True,
|
||||||
@ -192,19 +186,19 @@ GARMIN_ENTITY_LIST = {
|
|||||||
],
|
],
|
||||||
"moderateIntensityMinutes": [
|
"moderateIntensityMinutes": [
|
||||||
"Moderate Intensity",
|
"Moderate Intensity",
|
||||||
"minutes",
|
"min",
|
||||||
"mdi:flash-alert",
|
"mdi:flash-alert",
|
||||||
None,
|
None,
|
||||||
False,
|
False,
|
||||||
],
|
],
|
||||||
"vigorousIntensityMinutes": [
|
"vigorousIntensityMinutes": [
|
||||||
"Vigorous Intensity",
|
"Vigorous Intensity",
|
||||||
"minutes",
|
"min",
|
||||||
"mdi:run-fast",
|
"mdi:run-fast",
|
||||||
None,
|
None,
|
||||||
False,
|
False,
|
||||||
],
|
],
|
||||||
"intensityMinutesGoal": ["Intensity Goal", "minutes", "mdi:run-fast", None, False],
|
"intensityMinutesGoal": ["Intensity Goal", "min", "mdi:run-fast", None, False],
|
||||||
"bodyBatteryChargedValue": [
|
"bodyBatteryChargedValue": [
|
||||||
"Body Battery Charged",
|
"Body Battery Charged",
|
||||||
"%",
|
"%",
|
||||||
|
@ -165,9 +165,9 @@ class GarminConnectSensor(Entity):
|
|||||||
return
|
return
|
||||||
|
|
||||||
data = self._data.data
|
data = self._data.data
|
||||||
if "Duration" in self._type:
|
if "Duration" in self._type and data[self._type]:
|
||||||
self._state = data[self._type] // 60
|
self._state = data[self._type] // 60
|
||||||
elif "Seconds" in self._type:
|
elif "Seconds" in self._type and data[self._type]:
|
||||||
self._state = data[self._type] // 60
|
self._state = data[self._type] // 60
|
||||||
else:
|
else:
|
||||||
self._state = data[self._type]
|
self._state = data[self._type]
|
||||||
|
@ -510,7 +510,7 @@ async def async_migrate_entry(hass: HomeAssistantType, config_entry: ConfigEntry
|
|||||||
"""Migrate config entry to new version."""
|
"""Migrate config entry to new version."""
|
||||||
if config_entry.version == 1:
|
if config_entry.version == 1:
|
||||||
options = config_entry.options
|
options = config_entry.options
|
||||||
recipient = options[CONF_RECIPIENT]
|
recipient = options.get(CONF_RECIPIENT)
|
||||||
if isinstance(recipient, str):
|
if isinstance(recipient, str):
|
||||||
options[CONF_RECIPIENT] = [x.strip() for x in recipient.split(",")]
|
options[CONF_RECIPIENT] = [x.strip() for x in recipient.split(",")]
|
||||||
config_entry.version = 2
|
config_entry.version = 2
|
||||||
|
@ -26,6 +26,7 @@ from .const import (
|
|||||||
DEVICE_DISPLAY_NAME,
|
DEVICE_DISPLAY_NAME,
|
||||||
DEVICE_ID,
|
DEVICE_ID,
|
||||||
DEVICE_LOCATION,
|
DEVICE_LOCATION,
|
||||||
|
DEVICE_LOCATION_HORIZONTAL_ACCURACY,
|
||||||
DEVICE_LOCATION_LATITUDE,
|
DEVICE_LOCATION_LATITUDE,
|
||||||
DEVICE_LOCATION_LONGITUDE,
|
DEVICE_LOCATION_LONGITUDE,
|
||||||
DEVICE_LOST_MODE_CAPABLE,
|
DEVICE_LOST_MODE_CAPABLE,
|
||||||
@ -175,8 +176,9 @@ class IcloudAccount:
|
|||||||
|
|
||||||
def _determine_interval(self) -> int:
|
def _determine_interval(self) -> int:
|
||||||
"""Calculate new interval between two API fetch (in minutes)."""
|
"""Calculate new interval between two API fetch (in minutes)."""
|
||||||
intervals = {}
|
intervals = {"default": self._max_interval}
|
||||||
for device in self._devices.values():
|
for device in self._devices.values():
|
||||||
|
# Max interval if no location
|
||||||
if device.location is None:
|
if device.location is None:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
@ -186,10 +188,11 @@ class IcloudAccount:
|
|||||||
self.hass,
|
self.hass,
|
||||||
device.location[DEVICE_LOCATION_LATITUDE],
|
device.location[DEVICE_LOCATION_LATITUDE],
|
||||||
device.location[DEVICE_LOCATION_LONGITUDE],
|
device.location[DEVICE_LOCATION_LONGITUDE],
|
||||||
|
device.location[DEVICE_LOCATION_HORIZONTAL_ACCURACY],
|
||||||
).result()
|
).result()
|
||||||
|
|
||||||
|
# Max interval if in zone
|
||||||
if current_zone is not None:
|
if current_zone is not None:
|
||||||
intervals[device.name] = self._max_interval
|
|
||||||
continue
|
continue
|
||||||
|
|
||||||
zones = (
|
zones = (
|
||||||
@ -209,6 +212,7 @@ class IcloudAccount:
|
|||||||
)
|
)
|
||||||
distances.append(round(zone_distance / 1000, 1))
|
distances.append(round(zone_distance / 1000, 1))
|
||||||
|
|
||||||
|
# Max interval if no zone
|
||||||
if not distances:
|
if not distances:
|
||||||
continue
|
continue
|
||||||
mindistance = min(distances)
|
mindistance = min(distances)
|
||||||
|
@ -30,7 +30,7 @@ dump:
|
|||||||
fields:
|
fields:
|
||||||
topic:
|
topic:
|
||||||
description: topic to listen to
|
description: topic to listen to
|
||||||
example: "openzwave/#"
|
example: "OpenZWave/#"
|
||||||
duration:
|
duration:
|
||||||
description: how long we should listen for messages in seconds
|
description: how long we should listen for messages in seconds
|
||||||
example: 5
|
example: 5
|
||||||
|
@ -5,7 +5,12 @@ import logging
|
|||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.const import CONF_CLIENT_ID, CONF_CLIENT_SECRET
|
from homeassistant.const import (
|
||||||
|
CONF_CLIENT_ID,
|
||||||
|
CONF_CLIENT_SECRET,
|
||||||
|
CONF_DISCOVERY,
|
||||||
|
CONF_USERNAME,
|
||||||
|
)
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.helpers import config_entry_oauth2_flow, config_validation as cv
|
from homeassistant.helpers import config_entry_oauth2_flow, config_validation as cv
|
||||||
|
|
||||||
@ -14,12 +19,19 @@ from .const import AUTH, DATA_PERSONS, DOMAIN, OAUTH2_AUTHORIZE, OAUTH2_TOKEN
|
|||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
CONF_SECRET_KEY = "secret_key"
|
||||||
|
CONF_WEBHOOKS = "webhooks"
|
||||||
|
|
||||||
CONFIG_SCHEMA = vol.Schema(
|
CONFIG_SCHEMA = vol.Schema(
|
||||||
{
|
{
|
||||||
DOMAIN: vol.Schema(
|
DOMAIN: vol.Schema(
|
||||||
{
|
{
|
||||||
vol.Required(CONF_CLIENT_ID): cv.string,
|
vol.Required(CONF_CLIENT_ID): cv.string,
|
||||||
vol.Required(CONF_CLIENT_SECRET): cv.string,
|
vol.Required(CONF_CLIENT_SECRET): cv.string,
|
||||||
|
cv.deprecated(CONF_SECRET_KEY): cv.match_all,
|
||||||
|
cv.deprecated(CONF_USERNAME): cv.match_all,
|
||||||
|
cv.deprecated(CONF_WEBHOOKS): cv.match_all,
|
||||||
|
cv.deprecated(CONF_DISCOVERY): cv.match_all,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
|
@ -25,24 +25,22 @@ class NetatmoFlowHandler(
|
|||||||
@property
|
@property
|
||||||
def extra_authorize_data(self) -> dict:
|
def extra_authorize_data(self) -> dict:
|
||||||
"""Extra data that needs to be appended to the authorize url."""
|
"""Extra data that needs to be appended to the authorize url."""
|
||||||
return {
|
scopes = [
|
||||||
"scope": (
|
"read_camera",
|
||||||
" ".join(
|
"read_homecoach",
|
||||||
[
|
"read_presence",
|
||||||
"read_station",
|
"read_smokedetector",
|
||||||
"read_camera",
|
"read_station",
|
||||||
"access_camera",
|
"read_thermostat",
|
||||||
"write_camera",
|
"write_camera",
|
||||||
"read_presence",
|
"write_thermostat",
|
||||||
"access_presence",
|
]
|
||||||
"read_homecoach",
|
|
||||||
"read_smokedetector",
|
if self.flow_impl.name != "Home Assistant Cloud":
|
||||||
"read_thermostat",
|
scopes.extend(["access_camera", "access_presence"])
|
||||||
"write_thermostat",
|
scopes.sort()
|
||||||
]
|
|
||||||
)
|
return {"scope": " ".join(scopes)}
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
async def async_step_user(self, user_input=None):
|
async def async_step_user(self, user_input=None):
|
||||||
"""Handle a flow start."""
|
"""Handle a flow start."""
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
"domain": "webostv",
|
"domain": "webostv",
|
||||||
"name": "LG webOS Smart TV",
|
"name": "LG webOS Smart TV",
|
||||||
"documentation": "https://www.home-assistant.io/integrations/webostv",
|
"documentation": "https://www.home-assistant.io/integrations/webostv",
|
||||||
"requirements": ["aiopylgtv==0.3.2"],
|
"requirements": ["aiopylgtv==0.3.3"],
|
||||||
"dependencies": ["configurator"],
|
"dependencies": ["configurator"],
|
||||||
"codeowners": ["@bendavid"]
|
"codeowners": ["@bendavid"]
|
||||||
}
|
}
|
||||||
|
@ -228,7 +228,7 @@ async def async_setup(hass: HomeAssistant, config: Dict) -> bool:
|
|||||||
conf = await component.async_prepare_reload(skip_reset=True)
|
conf = await component.async_prepare_reload(skip_reset=True)
|
||||||
if conf is None:
|
if conf is None:
|
||||||
return
|
return
|
||||||
await yaml_collection.async_load(conf[DOMAIN])
|
await yaml_collection.async_load(conf.get(DOMAIN, []))
|
||||||
|
|
||||||
service.async_register_admin_service(
|
service.async_register_admin_service(
|
||||||
hass,
|
hass,
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
"""Constants used by Home Assistant components."""
|
"""Constants used by Home Assistant components."""
|
||||||
MAJOR_VERSION = 0
|
MAJOR_VERSION = 0
|
||||||
MINOR_VERSION = 105
|
MINOR_VERSION = 105
|
||||||
PATCH_VERSION = "1"
|
PATCH_VERSION = "2"
|
||||||
__short_version__ = f"{MAJOR_VERSION}.{MINOR_VERSION}"
|
__short_version__ = f"{MAJOR_VERSION}.{MINOR_VERSION}"
|
||||||
__version__ = f"{__short_version__}.{PATCH_VERSION}"
|
__version__ = f"{__short_version__}.{PATCH_VERSION}"
|
||||||
REQUIRED_PYTHON_VER = (3, 7, 0)
|
REQUIRED_PYTHON_VER = (3, 7, 0)
|
||||||
|
@ -190,7 +190,7 @@ aionotion==1.1.0
|
|||||||
aiopvapi==1.6.14
|
aiopvapi==1.6.14
|
||||||
|
|
||||||
# homeassistant.components.webostv
|
# homeassistant.components.webostv
|
||||||
aiopylgtv==0.3.2
|
aiopylgtv==0.3.3
|
||||||
|
|
||||||
# homeassistant.components.switcher_kis
|
# homeassistant.components.switcher_kis
|
||||||
aioswitcher==2019.4.26
|
aioswitcher==2019.4.26
|
||||||
|
@ -69,7 +69,7 @@ aiohue==1.10.1
|
|||||||
aionotion==1.1.0
|
aionotion==1.1.0
|
||||||
|
|
||||||
# homeassistant.components.webostv
|
# homeassistant.components.webostv
|
||||||
aiopylgtv==0.3.2
|
aiopylgtv==0.3.3
|
||||||
|
|
||||||
# homeassistant.components.switcher_kis
|
# homeassistant.components.switcher_kis
|
||||||
aioswitcher==2019.4.26
|
aioswitcher==2019.4.26
|
||||||
|
@ -54,15 +54,15 @@ async def test_full_flow(hass, aiohttp_client, aioclient_mock):
|
|||||||
|
|
||||||
scope = "+".join(
|
scope = "+".join(
|
||||||
[
|
[
|
||||||
"read_station",
|
|
||||||
"read_camera",
|
|
||||||
"access_camera",
|
"access_camera",
|
||||||
"write_camera",
|
|
||||||
"read_presence",
|
|
||||||
"access_presence",
|
"access_presence",
|
||||||
|
"read_camera",
|
||||||
"read_homecoach",
|
"read_homecoach",
|
||||||
|
"read_presence",
|
||||||
"read_smokedetector",
|
"read_smokedetector",
|
||||||
|
"read_station",
|
||||||
"read_thermostat",
|
"read_thermostat",
|
||||||
|
"write_camera",
|
||||||
"write_thermostat",
|
"write_thermostat",
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user