Skip to content
Merged

0.104.1 #30853

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion azure-pipelines-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
16 changes: 8 additions & 8 deletions homeassistant/components/ambient_station/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
from .config_flow import configured_instances
from .const import (
ATTR_LAST_DATA,
ATTR_MONITORED_CONDITIONS,
CONF_APP_KEY,
DATA_CLIENT,
DOMAIN,
Expand Down Expand Up @@ -341,7 +342,6 @@ def __init__(self, hass, config_entry, client):
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):
Expand Down Expand Up @@ -398,19 +398,19 @@ def on_subscribed(data):

_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"]
),
Expand Down
10 changes: 8 additions & 2 deletions homeassistant/components/ambient_station/binary_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,13 @@
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__)

Expand All @@ -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(
Expand Down
1 change: 1 addition & 0 deletions homeassistant/components/ambient_station/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
DOMAIN = "ambient_station"

ATTR_LAST_DATA = "last_data"
ATTR_MONITORED_CONDITIONS = "monitored_conditions"

CONF_APP_KEY = "app_key"

Expand Down
10 changes: 8 additions & 2 deletions homeassistant/components/ambient_station/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,13 @@
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__)

Expand All @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/emulated_roku/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": []
}
8 changes: 6 additions & 2 deletions homeassistant/components/hue/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,11 @@
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),
],
)
}
)
Expand All @@ -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:
Expand Down
9 changes: 5 additions & 4 deletions homeassistant/components/icloud/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,10 +297,11 @@ def setup(self):
self._owner_fullname = f"{user_info['firstName']} {user_info['lastName']}"

self._family_members_fullname = {}
for prs_id, member in user_info["membersInfo"].items():
self._family_members_fullname[
prs_id
] = f"{member['firstName']} {member['lastName']}"
if user_info.get("membersInfo") is not None:
for prs_id, member in user_info["membersInfo"].items():
self._family_members_fullname[
prs_id
] = f"{member['firstName']} {member['lastName']}"

self._devices = {}
self.update_devices()
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/mikrotik/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ def connect_to_device(self):

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):
Expand Down
4 changes: 2 additions & 2 deletions homeassistant/components/mpd/media_player.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,8 @@ def _fetch_status(self):
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

Expand Down
12 changes: 7 additions & 5 deletions homeassistant/components/msteams/notify.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -60,8 +62,8 @@ def send_message(self, message=None, **kwargs):

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)
2 changes: 1 addition & 1 deletion homeassistant/components/webostv/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
}
2 changes: 1 addition & 1 deletion homeassistant/components/webostv/media_player.py
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ async def async_play_media(self, media_type, media_id, **kwargs):
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
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/const.py
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
4 changes: 2 additions & 2 deletions requirements_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions requirements_test_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions tests/components/hue/test_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
}
}
},
Expand All @@ -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",
}
}

Expand Down