Merge pull request #30853 from home-assistant/rc

0.104.1
This commit is contained in:
Paulus Schoutsen 2020-01-16 12:47:51 -08:00 committed by GitHub
commit 09f7a09ce7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
17 changed files with 57 additions and 35 deletions

View File

@ -43,7 +43,7 @@ stages:
release="$(Build.SourceBranchName)"
created_by="$(curl -s https://api.github.com/repos/home-assistant/home-assistant/releases/tags/${release} | jq --raw-output '.author.login')"
if [[ "${created_by}" =~ ^(balloob|pvizeli|fabaff|robbiet480|bramkragten)$ ]]; then
if [[ "${created_by}" =~ ^(balloob|pvizeli|fabaff|robbiet480|bramkragten|frenck)$ ]]; then
exit 0
fi

View File

@ -26,6 +26,7 @@ from homeassistant.helpers.event import async_call_later
from .config_flow import configured_instances
from .const import (
ATTR_LAST_DATA,
ATTR_MONITORED_CONDITIONS,
CONF_APP_KEY,
DATA_CLIENT,
DOMAIN,
@ -341,7 +342,6 @@ class AmbientStation:
self._watchdog_listener = None
self._ws_reconnect_delay = DEFAULT_SOCKET_MIN_RETRY
self.client = client
self.monitored_conditions = []
self.stations = {}
async def _attempt_connect(self):
@ -398,19 +398,19 @@ class AmbientStation:
_LOGGER.debug("New station subscription: %s", data)
self.monitored_conditions = [
# Only create entities based on the data coming through the socket.
# If the user is monitoring brightness (in W/m^2), make sure we also
# add a calculated sensor for the same data measured in lx:
monitored_conditions = [
k for k in station["lastData"] if k in SENSOR_TYPES
]
# If the user is monitoring brightness (in W/m^2),
# make sure we also add a calculated sensor for the
# same data measured in lx:
if TYPE_SOLARRADIATION in self.monitored_conditions:
self.monitored_conditions.append(TYPE_SOLARRADIATION_LX)
if TYPE_SOLARRADIATION in monitored_conditions:
monitored_conditions.append(TYPE_SOLARRADIATION_LX)
self.stations[station["macAddress"]] = {
ATTR_LAST_DATA: station["lastData"],
ATTR_LOCATION: station.get("info", {}).get("location"),
ATTR_MONITORED_CONDITIONS: monitored_conditions,
ATTR_NAME: station.get("info", {}).get(
"name", station["macAddress"]
),

View File

@ -19,7 +19,13 @@ from . import (
TYPE_BATTOUT,
AmbientWeatherEntity,
)
from .const import ATTR_LAST_DATA, DATA_CLIENT, DOMAIN, TYPE_BINARY_SENSOR
from .const import (
ATTR_LAST_DATA,
ATTR_MONITORED_CONDITIONS,
DATA_CLIENT,
DOMAIN,
TYPE_BINARY_SENSOR,
)
_LOGGER = logging.getLogger(__name__)
@ -35,7 +41,7 @@ async def async_setup_entry(hass, entry, async_add_entities):
binary_sensor_list = []
for mac_address, station in ambient.stations.items():
for condition in ambient.monitored_conditions:
for condition in station[ATTR_MONITORED_CONDITIONS]:
name, _, kind, device_class = SENSOR_TYPES[condition]
if kind == TYPE_BINARY_SENSOR:
binary_sensor_list.append(

View File

@ -2,6 +2,7 @@
DOMAIN = "ambient_station"
ATTR_LAST_DATA = "last_data"
ATTR_MONITORED_CONDITIONS = "monitored_conditions"
CONF_APP_KEY = "app_key"

View File

@ -9,7 +9,13 @@ from . import (
TYPE_SOLARRADIATION_LX,
AmbientWeatherEntity,
)
from .const import ATTR_LAST_DATA, DATA_CLIENT, DOMAIN, TYPE_SENSOR
from .const import (
ATTR_LAST_DATA,
ATTR_MONITORED_CONDITIONS,
DATA_CLIENT,
DOMAIN,
TYPE_SENSOR,
)
_LOGGER = logging.getLogger(__name__)
@ -25,7 +31,7 @@ async def async_setup_entry(hass, entry, async_add_entities):
sensor_list = []
for mac_address, station in ambient.stations.items():
for condition in ambient.monitored_conditions:
for condition in station[ATTR_MONITORED_CONDITIONS]:
name, unit, kind, device_class = SENSOR_TYPES[condition]
if kind == TYPE_SENSOR:
sensor_list.append(

View File

@ -3,7 +3,7 @@
"name": "Emulated Roku",
"config_flow": true,
"documentation": "https://www.home-assistant.io/integrations/emulated_roku",
"requirements": ["emulated_roku==0.1.8"],
"requirements": ["emulated_roku==0.1.9"],
"dependencies": [],
"codeowners": []
}

View File

@ -44,7 +44,11 @@ CONFIG_SCHEMA = vol.Schema(
DOMAIN: vol.Schema(
{
vol.Optional(CONF_BRIDGES): vol.All(
cv.ensure_list, [BRIDGE_CONFIG_SCHEMA]
cv.ensure_list,
[
cv.deprecated("filename", invalidation_version="0.106.0"),
vol.All(BRIDGE_CONFIG_SCHEMA),
],
)
}
)
@ -69,7 +73,7 @@ async def async_setup(hass, config):
bridges = conf[CONF_BRIDGES]
configured_hosts = set(
entry.data["host"] for entry in hass.config_entries.async_entries(DOMAIN)
entry.data.get("host") for entry in hass.config_entries.async_entries(DOMAIN)
)
for bridge_conf in bridges:

View File

@ -297,6 +297,7 @@ class IcloudAccount:
self._owner_fullname = f"{user_info['firstName']} {user_info['lastName']}"
self._family_members_fullname = {}
if user_info.get("membersInfo") is not None:
for prs_id, member in user_info["membersInfo"].items():
self._family_members_fullname[
prs_id

View File

@ -167,7 +167,7 @@ class MikrotikClient:
def get_hostname(self):
"""Return device host name."""
data = self.command(MIKROTIK_SERVICES[IDENTITY])
data = list(self.command(MIKROTIK_SERVICES[IDENTITY]))
return data[0][NAME] if data else None
def connected(self):

View File

@ -133,8 +133,8 @@ class MpdDevice(MediaPlayerDevice):
self._status = self._client.status()
self._currentsong = self._client.currentsong()
position = self._status["time"]
if self._media_position != position:
position = self._status.get("time")
if position is not None and self._media_position != position:
self._media_position_updated_at = dt_util.utcnow()
self._media_position = position

View File

@ -39,16 +39,18 @@ class MSTeamsNotificationService(BaseNotificationService):
def __init__(self, webhook_url):
"""Initialize the service."""
self._webhook_url = webhook_url
self.teams_message = pymsteams.connectorcard(self._webhook_url)
def send_message(self, message=None, **kwargs):
"""Send a message to the webhook."""
teams_message = pymsteams.connectorcard(self._webhook_url)
title = kwargs.get(ATTR_TITLE, ATTR_TITLE_DEFAULT)
data = kwargs.get(ATTR_DATA)
self.teams_message.title(title)
teams_message.title(title)
self.teams_message.text(message)
teams_message.text(message)
if data is not None:
file_url = data.get(ATTR_FILE_URL)
@ -60,8 +62,8 @@ class MSTeamsNotificationService(BaseNotificationService):
message_section = pymsteams.cardsection()
message_section.addImage(file_url)
self.teams_message.addSection(message_section)
teams_message.addSection(message_section)
try:
self.teams_message.send()
teams_message.send()
except RuntimeError as err:
_LOGGER.error("Could not send notification. Error: %s", err)

View File

@ -2,7 +2,7 @@
"domain": "webostv",
"name": "LG webOS Smart TV",
"documentation": "https://www.home-assistant.io/integrations/webostv",
"requirements": ["aiopylgtv==0.2.6"],
"requirements": ["aiopylgtv==0.2.7"],
"dependencies": ["configurator"],
"codeowners": ["@bendavid"]
}

View File

@ -351,7 +351,7 @@ class LgWebOSMediaPlayerEntity(MediaPlayerDevice):
partial_match_channel_id = None
perfect_match_channel_id = None
for channel in self._client.get_channels():
for channel in await self._client.get_channels():
if media_id == channel["channelNumber"]:
perfect_match_channel_id = channel["channelId"]
continue

View File

@ -1,7 +1,7 @@
"""Constants used by Home Assistant components."""
MAJOR_VERSION = 0
MINOR_VERSION = 104
PATCH_VERSION = "0"
PATCH_VERSION = "1"
__short_version__ = f"{MAJOR_VERSION}.{MINOR_VERSION}"
__version__ = f"{__short_version__}.{PATCH_VERSION}"
REQUIRED_PYTHON_VER = (3, 7, 0)

View File

@ -190,7 +190,7 @@ aionotion==1.1.0
aiopvapi==1.6.14
# homeassistant.components.webostv
aiopylgtv==0.2.6
aiopylgtv==0.2.7
# homeassistant.components.switcher_kis
aioswitcher==2019.4.26
@ -477,7 +477,7 @@ eliqonline==1.2.2
elkm1-lib==0.7.15
# homeassistant.components.emulated_roku
emulated_roku==0.1.8
emulated_roku==0.1.9
# homeassistant.components.enocean
enocean==0.50

View File

@ -69,7 +69,7 @@ aiohue==1.10.1
aionotion==1.1.0
# homeassistant.components.webostv
aiopylgtv==0.2.6
aiopylgtv==0.2.7
# homeassistant.components.switcher_kis
aioswitcher==2019.4.26
@ -171,7 +171,7 @@ eebrightbox==0.0.4
elgato==0.2.0
# homeassistant.components.emulated_roku
emulated_roku==0.1.8
emulated_roku==0.1.9
# homeassistant.components.season
ephem==3.7.7.0

View File

@ -33,6 +33,7 @@ async def test_setup_defined_hosts_known_auth(hass):
hue.CONF_HOST: "0.0.0.0",
hue.CONF_ALLOW_HUE_GROUPS: False,
hue.CONF_ALLOW_UNREACHABLE: True,
"filename": "bla",
}
}
},
@ -49,6 +50,7 @@ async def test_setup_defined_hosts_known_auth(hass):
hue.CONF_HOST: "0.0.0.0",
hue.CONF_ALLOW_HUE_GROUPS: False,
hue.CONF_ALLOW_UNREACHABLE: True,
"filename": "bla",
}
}