diff --git a/homeassistant/components/dwd_weather_warnings/manifest.json b/homeassistant/components/dwd_weather_warnings/manifest.json index 19dcf2860d74cf..0a9f972c84ee3e 100644 --- a/homeassistant/components/dwd_weather_warnings/manifest.json +++ b/homeassistant/components/dwd_weather_warnings/manifest.json @@ -4,5 +4,6 @@ "documentation": "https://www.home-assistant.io/integrations/dwd_weather_warnings", "requirements": [], "dependencies": [], + "after_dependencies": ["rest"], "codeowners": [] } diff --git a/homeassistant/components/emulated_hue/manifest.json b/homeassistant/components/emulated_hue/manifest.json index c3c0302dbc3001..37848e6f3060a5 100644 --- a/homeassistant/components/emulated_hue/manifest.json +++ b/homeassistant/components/emulated_hue/manifest.json @@ -4,6 +4,7 @@ "documentation": "https://www.home-assistant.io/integrations/emulated_hue", "requirements": ["aiohttp_cors==0.7.0"], "dependencies": [], + "after_dependencies": ["http"], "codeowners": [], "quality_scale": "internal" } diff --git a/homeassistant/components/logbook/__init__.py b/homeassistant/components/logbook/__init__.py index ac45a636bf72d7..5d07a1fa0b51bc 100644 --- a/homeassistant/components/logbook/__init__.py +++ b/homeassistant/components/logbook/__init__.py @@ -199,6 +199,9 @@ def humanify(hass, events): """ domain_prefixes = tuple(f"{dom}." for dom in CONTINUOUS_DOMAINS) + # Track last states to filter out duplicates + last_state = {} + # Group events in batches of GROUP_BY_MINUTES for _, g_events in groupby( events, lambda event: event.time_fired.minute // GROUP_BY_MINUTES @@ -236,9 +239,15 @@ def humanify(hass, events): # Yield entries for event in events_batch: if event.event_type == EVENT_STATE_CHANGED: - to_state = State.from_dict(event.data.get("new_state")) + # Filter out states that become same state again (force_update=True) + # or light becoming different color + if last_state.get(to_state.entity_id) == to_state.state: + continue + + last_state[to_state.entity_id] = to_state.state + domain = to_state.domain # Skip all but the last sensor state diff --git a/homeassistant/components/pushover/notify.py b/homeassistant/components/pushover/notify.py index bc44cbeddb7419..01d4d8fddde75b 100644 --- a/homeassistant/components/pushover/notify.py +++ b/homeassistant/components/pushover/notify.py @@ -61,7 +61,7 @@ def send_message(self, message="", **kwargs): url = data.get(ATTR_URL, None) url_title = data.get(ATTR_URL_TITLE, None) priority = data.get(ATTR_PRIORITY, None) - retry = data.get(ATTR_PRIORITY, None) + retry = data.get(ATTR_RETRY, None) expire = data.get(ATTR_EXPIRE, None) callback_url = data.get(ATTR_CALLBACK_URL, None) timestamp = data.get(ATTR_TIMESTAMP, None) diff --git a/homeassistant/components/pvoutput/manifest.json b/homeassistant/components/pvoutput/manifest.json index 1cc1f7aa2f648b..0ca7af3485d1c0 100644 --- a/homeassistant/components/pvoutput/manifest.json +++ b/homeassistant/components/pvoutput/manifest.json @@ -4,5 +4,6 @@ "documentation": "https://www.home-assistant.io/integrations/pvoutput", "requirements": [], "dependencies": [], + "after_dependencies": ["rest"], "codeowners": ["@fabaff"] } diff --git a/homeassistant/components/tesla/device_tracker.py b/homeassistant/components/tesla/device_tracker.py index 08e5d58ba6e6ef..f39d8055b125fd 100644 --- a/homeassistant/components/tesla/device_tracker.py +++ b/homeassistant/components/tesla/device_tracker.py @@ -68,3 +68,8 @@ def should_poll(self): def source_type(self): """Return the source type, eg gps or router, of the device.""" return SOURCE_TYPE_GPS + + @property + def force_update(self): + """All updates do not need to be written to the state machine.""" + return False diff --git a/homeassistant/components/unifi/manifest.json b/homeassistant/components/unifi/manifest.json index a42b136e665cef..85633ebf131977 100644 --- a/homeassistant/components/unifi/manifest.json +++ b/homeassistant/components/unifi/manifest.json @@ -4,7 +4,7 @@ "config_flow": true, "documentation": "https://www.home-assistant.io/integrations/unifi", "requirements": [ - "aiounifi==13" + "aiounifi==14" ], "dependencies": [], "codeowners": [ diff --git a/homeassistant/const.py b/homeassistant/const.py index fd4ac8cc1a168e..aca7adc28a5df2 100644 --- a/homeassistant/const.py +++ b/homeassistant/const.py @@ -1,7 +1,7 @@ """Constants used by Home Assistant components.""" MAJOR_VERSION = 0 MINOR_VERSION = 106 -PATCH_VERSION = "4" +PATCH_VERSION = "5" __short_version__ = f"{MAJOR_VERSION}.{MINOR_VERSION}" __version__ = f"{__short_version__}.{PATCH_VERSION}" REQUIRED_PYTHON_VER = (3, 7, 0) diff --git a/requirements_all.txt b/requirements_all.txt index 3cae53619bf0f1..111450d0193a48 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -199,7 +199,7 @@ aiopylgtv==0.3.3 aioswitcher==2019.4.26 # homeassistant.components.unifi -aiounifi==13 +aiounifi==14 # homeassistant.components.wwlln aiowwlln==2.0.2 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index 42e71a8996e31f..26fd8eccdb2800 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -78,7 +78,7 @@ aiopylgtv==0.3.3 aioswitcher==2019.4.26 # homeassistant.components.unifi -aiounifi==13 +aiounifi==14 # homeassistant.components.wwlln aiowwlln==2.0.2 diff --git a/script/hassfest/dependencies.py b/script/hassfest/dependencies.py index c909b6216a93f4..934400533e1f07 100644 --- a/script/hassfest/dependencies.py +++ b/script/hassfest/dependencies.py @@ -65,7 +65,7 @@ def visit_Attribute(self, node): # self.hass.components.hue.async_create() # Name(id=self) - # .Attribute(attr=hass) + # .Attribute(attr=hass) or .Attribute(attr=_hass) # .Attribute(attr=hue) # .Attribute(attr=async_create) if ( @@ -78,7 +78,7 @@ def visit_Attribute(self, node): ) or ( isinstance(node.value.value, ast.Attribute) - and node.value.value.attr == "hass" + and node.value.value.attr in ("hass", "_hass") ) ) ): @@ -89,20 +89,47 @@ def visit_Attribute(self, node): ALLOWED_USED_COMPONENTS = { - # This component will always be set up - "persistent_notification", - # These allow to register things without being set up + # Internal integrations + "alert", + "automation", "conversation", + "device_automation", "frontend", + "group", "hassio", + "homeassistant", + "input_boolean", + "input_datetime", + "input_number", + "input_select", + "input_text", + "persistent_notification", + "person", + "script", + "shopping_list", + "sun", "system_health", + "system_log", + "timer", + "webhook", "websocket_api", - "automation", - "device_automation", "zone", - "homeassistant", - "system_log", - "person", + # Entity integrations with platforms + "alarm_control_panel", + "binary_sensor", + "climate", + "cover", + "device_tracker", + "fan", + "image_processing", + "light", + "lock", + "media_player", + "scene", + "sensor", + "switch", + "vacuum", + "water_heater", # Other "mjpeg", # base class, has no reqs or component to load. "stream", # Stream cannot install on all systems, can be imported without reqs. @@ -121,18 +148,7 @@ def visit_Attribute(self, node): # This should become a helper method that integrations can submit data to ("websocket_api", "lovelace"), ("websocket_api", "shopping_list"), - # Expose HA to external systems - "homekit", - "alexa", - "google_assistant", - "emulated_hue", - "prometheus", - "conversation", "logbook", - "mobile_app", - # These should be extracted to external package - "pvoutput", - "dwd_weather_warnings", } diff --git a/tests/components/logbook/test_init.py b/tests/components/logbook/test_init.py index 70e769a54f2d58..750ad17b5232f3 100644 --- a/tests/components/logbook/test_init.py +++ b/tests/components/logbook/test_init.py @@ -1484,3 +1484,36 @@ async def test_humanify_script_started_event(hass): assert event2["domain"] == "script" assert event2["message"] == "started" assert event2["entity_id"] == "script.bye" + + +async def test_humanify_same_state(hass): + """Test humanifying Script Run event.""" + state_50 = ha.State("light.kitchen", "on", {"brightness": 50}).as_dict() + state_100 = ha.State("light.kitchen", "on", {"brightness": 100}).as_dict() + state_200 = ha.State("light.kitchen", "on", {"brightness": 200}).as_dict() + + events = list( + logbook.humanify( + hass, + [ + ha.Event( + EVENT_STATE_CHANGED, + { + "entity_id": "light.kitchen", + "old_state": state_50, + "new_state": state_100, + }, + ), + ha.Event( + EVENT_STATE_CHANGED, + { + "entity_id": "light.kitchen", + "old_state": state_100, + "new_state": state_200, + }, + ), + ], + ) + ) + + assert len(events) == 1