Skip to content

Commit

Permalink
Merge pull request #37443 from home-assistant/rc
Browse files Browse the repository at this point in the history
  • Loading branch information
balloob authored Jul 4, 2020
2 parents 460bd2b + 18c16c4 commit b76d7ed
Show file tree
Hide file tree
Showing 10 changed files with 46 additions and 20 deletions.
6 changes: 6 additions & 0 deletions homeassistant/components/logbook/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,12 @@ def log_message(service):
domain = service.data.get(ATTR_DOMAIN)
entity_id = service.data.get(ATTR_ENTITY_ID)

if entity_id is None and domain is None:
# If there is no entity_id or
# domain, the event will get filtered
# away so we use the "logbook" domain
domain = DOMAIN

message.hass = hass
message = message.async_render()
async_log_entry(hass, name, message, domain, entity_id)
Expand Down
8 changes: 6 additions & 2 deletions homeassistant/components/mqtt/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -476,10 +476,14 @@ async def async_setup_entry(hass, entry):
if conf is None:
conf = CONFIG_SCHEMA({DOMAIN: dict(entry.data)})[DOMAIN]
elif any(key in conf for key in entry.data):
_LOGGER.warning(
shared_keys = conf.keys() & entry.data.keys()
override = {k: entry.data[k] for k in shared_keys}
if CONF_PASSWORD in override:
override[CONF_PASSWORD] = "********"
_LOGGER.info(
"Data in your configuration entry is going to override your "
"configuration.yaml: %s",
entry.data,
override,
)

conf = _merge_config(entry, conf)
Expand Down
4 changes: 3 additions & 1 deletion homeassistant/components/recorder/migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,9 @@ def _create_index(engine, table_name, index_name):
try:
index.create(engine)
except OperationalError as err:
if "already exists" not in str(err).lower():
lower_err_str = str(err).lower()

if "already exists" not in lower_err_str and "duplicate" not in lower_err_str:
raise

_LOGGER.warning(
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/tesla/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
"name": "Tesla",
"config_flow": true,
"documentation": "https://www.home-assistant.io/integrations/tesla",
"requirements": ["teslajsonpy==0.9.0"],
"requirements": ["teslajsonpy==0.9.2"],
"codeowners": ["@zabuldon", "@alandtse"]
}
2 changes: 1 addition & 1 deletion homeassistant/components/tile/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
"name": "Tile",
"config_flow": true,
"documentation": "https://www.home-assistant.io/integrations/tile",
"requirements": ["pytile==3.0.6"],
"requirements": ["pytile==4.0.0"],
"codeowners": ["@bachya"]
}
2 changes: 1 addition & 1 deletion homeassistant/components/xiaomi_miio/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "Xiaomi Miio",
"config_flow": true,
"documentation": "https://www.home-assistant.io/integrations/xiaomi_miio",
"requirements": ["construct==2.9.45", "python-miio==0.5.1"],
"requirements": ["construct==2.9.45", "python-miio==0.5.2.1"],
"codeowners": ["@rytilahti", "@syssi"],
"zeroconf": ["_miio._udp.local."]
}
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 = 112
PATCH_VERSION = "1"
PATCH_VERSION = "2"
__short_version__ = f"{MAJOR_VERSION}.{MINOR_VERSION}"
__version__ = f"{__short_version__}.{PATCH_VERSION}"
REQUIRED_PYTHON_VER = (3, 7, 0)
Expand Down
6 changes: 3 additions & 3 deletions requirements_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1712,7 +1712,7 @@ python-juicenet==1.0.1
# python-lirc==1.2.3

# homeassistant.components.xiaomi_miio
python-miio==0.5.1
python-miio==0.5.2.1

# homeassistant.components.mpd
python-mpd2==1.0.0
Expand Down Expand Up @@ -1778,7 +1778,7 @@ python_opendata_transport==0.2.1
pythonegardia==1.0.40

# homeassistant.components.tile
pytile==3.0.6
pytile==4.0.0

# homeassistant.components.touchline
pytouchline==0.7
Expand Down Expand Up @@ -2094,7 +2094,7 @@ temperusb==1.5.3
tesla-powerwall==0.2.11

# homeassistant.components.tesla
teslajsonpy==0.9.0
teslajsonpy==0.9.2

# homeassistant.components.thermoworks_smoke
thermoworks_smoke==0.1.8
Expand Down
6 changes: 3 additions & 3 deletions requirements_test_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -748,7 +748,7 @@ python-izone==1.1.2
python-juicenet==1.0.1

# homeassistant.components.xiaomi_miio
python-miio==0.5.1
python-miio==0.5.2.1

# homeassistant.components.nest
python-nest==4.1.0
Expand All @@ -775,7 +775,7 @@ python-velbus==2.0.43
python_awair==0.1.1

# homeassistant.components.tile
pytile==3.0.6
pytile==4.0.0

# homeassistant.components.traccar
pytraccar==0.9.0
Expand Down Expand Up @@ -890,7 +890,7 @@ tellduslive==0.10.11
tesla-powerwall==0.2.11

# homeassistant.components.tesla
teslajsonpy==0.9.0
teslajsonpy==0.9.2

# homeassistant.components.toon
toonapi==0.1.0
Expand Down
28 changes: 21 additions & 7 deletions tests/components/logbook/test_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,15 @@ def event_listener(event):
},
True,
)

self.hass.services.call(
logbook.DOMAIN,
"log",
{
logbook.ATTR_NAME: "This entry",
logbook.ATTR_MESSAGE: "has no domain or entity_id",
},
True,
)
# Logbook entry service call results in firing an event.
# Our service call will unblock when the event listeners have been
# scheduled. This means that they may not have been processed yet.
Expand All @@ -92,15 +100,21 @@ def event_listener(event):
dt_util.utcnow() + timedelta(hours=1),
)
)
assert len(events) == 1
assert len(events) == 2

assert len(calls) == 2
first_call = calls[-2]

assert first_call.data.get(logbook.ATTR_NAME) == "Alarm"
assert first_call.data.get(logbook.ATTR_MESSAGE) == "is triggered"
assert first_call.data.get(logbook.ATTR_DOMAIN) == "switch"
assert first_call.data.get(logbook.ATTR_ENTITY_ID) == "switch.test_switch"

assert len(calls) == 1
last_call = calls[-1]

assert last_call.data.get(logbook.ATTR_NAME) == "Alarm"
assert last_call.data.get(logbook.ATTR_MESSAGE) == "is triggered"
assert last_call.data.get(logbook.ATTR_DOMAIN) == "switch"
assert last_call.data.get(logbook.ATTR_ENTITY_ID) == "switch.test_switch"
assert last_call.data.get(logbook.ATTR_NAME) == "This entry"
assert last_call.data.get(logbook.ATTR_MESSAGE) == "has no domain or entity_id"
assert last_call.data.get(logbook.ATTR_DOMAIN) == "logbook"

def test_service_call_create_log_book_entry_no_message(self):
"""Test if service call create log book entry without message."""
Expand Down

0 comments on commit b76d7ed

Please sign in to comment.