Skip to content
Merged

0.84.2 #19281

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 homeassistant/components/asuswrt.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from homeassistant.helpers import config_validation as cv
from homeassistant.helpers.discovery import async_load_platform

REQUIREMENTS = ['aioasuswrt==1.1.13']
REQUIREMENTS = ['aioasuswrt==1.1.15']

_LOGGER = logging.getLogger(__name__)

Expand Down
4 changes: 1 addition & 3 deletions homeassistant/components/binary_sensor/xiaomi_aqara.py
Original file line number Diff line number Diff line change
Expand Up @@ -423,9 +423,7 @@ def parse_data(self, data, raw_data):
})
self._last_action = click_type

if value in ['long_click_press', 'long_click_release']:
return True
return False
return True


class XiaomiCube(XiaomiBinarySensor):
Expand Down
6 changes: 5 additions & 1 deletion homeassistant/components/config/entity_registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ async def websocket_get_entity(hass, connection, msg):

@async_response
async def websocket_update_entity(hass, connection, msg):
"""Handle get camera thumbnail websocket command.
"""Handle update entity websocket command.

Async friendly.
"""
Expand All @@ -106,6 +106,10 @@ async def websocket_update_entity(hass, connection, msg):

if 'new_entity_id' in msg:
changes['new_entity_id'] = msg['new_entity_id']
if hass.states.get(msg['new_entity_id']) is not None:
connection.send_message(websocket_api.error_message(
msg['id'], 'invalid_info', 'Entity is already registered'))
return

try:
if changes:
Expand Down
5 changes: 2 additions & 3 deletions homeassistant/components/light/lutron.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class LutronLight(LutronDevice, Light):
def __init__(self, area_name, lutron_device, controller):
"""Initialize the light."""
self._prev_brightness = None
super().__init__(self, area_name, lutron_device, controller)
super().__init__(area_name, lutron_device, controller)

@property
def supported_features(self):
Expand Down Expand Up @@ -75,8 +75,7 @@ def turn_off(self, **kwargs):
@property
def device_state_attributes(self):
"""Return the state attributes."""
attr = {}
attr['lutron_integration_id'] = self._lutron_device.id
attr = {'lutron_integration_id': self._lutron_device.id}
return attr

@property
Expand Down
8 changes: 8 additions & 0 deletions homeassistant/components/logbook.py
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,14 @@ def _exclude_events(events, entities_filter):
domain = event.data.get(ATTR_DOMAIN)
entity_id = event.data.get(ATTR_ENTITY_ID)

elif event.event_type == EVENT_AUTOMATION_TRIGGERED:
domain = 'automation'
entity_id = event.data.get(ATTR_ENTITY_ID)

elif event.event_type == EVENT_SCRIPT_STARTED:
domain = 'script'
entity_id = event.data.get(ATTR_ENTITY_ID)

elif event.event_type == EVENT_ALEXA_SMART_HOME:
domain = 'alexa'

Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/owntracks/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

DOMAIN = "owntracks"
REQUIREMENTS = ['libnacl==1.6.1']
DEPENDENCIES = ['device_tracker', 'webhook']
DEPENDENCIES = ['webhook']

CONF_MAX_GPS_ACCURACY = 'max_gps_accuracy'
CONF_WAYPOINT_IMPORT = 'waypoints'
Expand Down
3 changes: 2 additions & 1 deletion homeassistant/components/tts/amazon_polly.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
https://home-assistant.io/components/tts.amazon_polly/
"""
import logging

import voluptuous as vol

from homeassistant.components.tts import Provider, PLATFORM_SCHEMA
Expand Down Expand Up @@ -56,7 +57,7 @@
'Cristiano', 'Ines', # Portuguese, European
'Carmen', # Romanian
'Maxim', 'Tatyana', # Russian
'Enrique', 'Conchita', 'Lucia' # Spanish European
'Enrique', 'Conchita', 'Lucia', # Spanish European
'Mia', # Spanish Mexican
'Miguel', 'Penelope', # Spanish US
'Astrid', # Swedish
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/zha/entities/entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,6 @@ def device_info(self):
'identifiers': {(DOMAIN, ieee)},
'manufacturer': self._endpoint.manufacturer,
'model': self._endpoint.model,
'name': self._device_state_attributes['friendly_name'],
'name': self._device_state_attributes.get('friendly_name', ieee),
'via_hub': (DOMAIN, self.hass.data[DATA_ZHA][DATA_ZHA_BRIDGE_ID]),
}
2 changes: 1 addition & 1 deletion homeassistant/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"""Constants used by Home Assistant components."""
MAJOR_VERSION = 0
MINOR_VERSION = 84
PATCH_VERSION = '1'
PATCH_VERSION = '2'
__short_version__ = '{}.{}'.format(MAJOR_VERSION, MINOR_VERSION)
__version__ = '{}.{}'.format(__short_version__, PATCH_VERSION)
REQUIRED_PYTHON_VER = (3, 5, 3)
Expand Down
3 changes: 2 additions & 1 deletion homeassistant/helpers/entity_platform.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,8 @@ async def _async_add_entity(self, entity, update_before_add,
self.domain, self.platform_name, entity.unique_id,
suggested_object_id=suggested_object_id,
config_entry_id=config_entry_id,
device_id=device_id)
device_id=device_id,
known_object_ids=self.entities.keys())

if entry.disabled:
self.logger.info(
Expand Down
5 changes: 3 additions & 2 deletions homeassistant/helpers/entity_registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def async_generate_entity_id(self, domain, suggested_object_id,
@callback
def async_get_or_create(self, domain, platform, unique_id, *,
suggested_object_id=None, config_entry_id=None,
device_id=None):
device_id=None, known_object_ids=None):
"""Get entity. Create if it doesn't exist."""
entity_id = self.async_get_entity_id(domain, platform, unique_id)
if entity_id:
Expand All @@ -126,7 +126,8 @@ def async_get_or_create(self, domain, platform, unique_id, *,
device_id=device_id)

entity_id = self.async_generate_entity_id(
domain, suggested_object_id or '{}_{}'.format(platform, unique_id))
domain, suggested_object_id or '{}_{}'.format(platform, unique_id),
known_object_ids)

entity = RegistryEntry(
entity_id=entity_id,
Expand Down
2 changes: 1 addition & 1 deletion requirements_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ abodepy==0.14.0
afsapi==0.0.4

# homeassistant.components.asuswrt
aioasuswrt==1.1.13
aioasuswrt==1.1.15

# homeassistant.components.device_tracker.automatic
aioautomatic==0.6.5
Expand Down
2 changes: 2 additions & 0 deletions tests/components/device_tracker/test_owntracks.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,8 @@ def setup_comp(hass):
"""Initialize components."""
mock_component(hass, 'group')
mock_component(hass, 'zone')
hass.loop.run_until_complete(async_setup_component(
hass, 'device_tracker', {}))
hass.loop.run_until_complete(async_mock_mqtt_component(hass))

hass.states.async_set(
Expand Down
42 changes: 35 additions & 7 deletions tests/components/test_logbook.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,22 +265,50 @@ def test_exclude_events_domain(self):
def test_exclude_automation_events(self):
"""Test if automation entries can be excluded by entity_id."""
name = 'My Automation Rule'
message = 'has been triggered'
domain = 'automation'
entity_id = 'automation.my_automation_rule'
entity_id2 = 'automation.my_automation_rule_2'
entity_id2 = 'sensor.blu'

eventA = ha.Event(logbook.EVENT_LOGBOOK_ENTRY, {
eventA = ha.Event(logbook.EVENT_AUTOMATION_TRIGGERED, {
logbook.ATTR_NAME: name,
logbook.ATTR_MESSAGE: message,
logbook.ATTR_DOMAIN: domain,
logbook.ATTR_ENTITY_ID: entity_id,
})
eventB = ha.Event(logbook.EVENT_LOGBOOK_ENTRY, {
eventB = ha.Event(logbook.EVENT_AUTOMATION_TRIGGERED, {
logbook.ATTR_NAME: name,
logbook.ATTR_ENTITY_ID: entity_id2,
})

config = logbook.CONFIG_SCHEMA({
ha.DOMAIN: {},
logbook.DOMAIN: {logbook.CONF_EXCLUDE: {
logbook.CONF_ENTITIES: [entity_id, ]}}})
events = logbook._exclude_events(
(ha.Event(EVENT_HOMEASSISTANT_STOP), eventA, eventB),
logbook._generate_filter_from_config(config[logbook.DOMAIN]))
entries = list(logbook.humanify(self.hass, events))

assert 2 == len(entries)
self.assert_entry(
entries[0], name='Home Assistant', message='stopped',
domain=ha.DOMAIN)
self.assert_entry(
entries[1], name=name, domain=domain, entity_id=entity_id2)

def test_exclude_script_events(self):
"""Test if script start can be excluded by entity_id."""
name = 'My Script Rule'
domain = 'script'
entity_id = 'script.my_script'
entity_id2 = 'script.my_script_2'
entity_id2 = 'sensor.blu'

eventA = ha.Event(logbook.EVENT_SCRIPT_STARTED, {
logbook.ATTR_NAME: name,
logbook.ATTR_ENTITY_ID: entity_id,
})
eventB = ha.Event(logbook.EVENT_SCRIPT_STARTED, {
logbook.ATTR_NAME: name,
logbook.ATTR_MESSAGE: message,
logbook.ATTR_DOMAIN: domain,
logbook.ATTR_ENTITY_ID: entity_id2,
})

Expand Down