8000 0.106.5 by balloob · Pull Request #32457 · home-assistant/core · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

0.106.5 #32457

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Mar 4, 2020
Merged

0.106.5 #32457

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
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
"documentation": "https://www.home-assistant.io/integrations/dwd_weather_warnings",
"requirements": [],
"dependencies": [],
"after_dependencies": ["rest"],
"codeowners": []
}
1 change: 1 addition & 0 deletions homeassistant/components/emulated_hue/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
11 changes: 10 additions & 1 deletion homeassistant/components/logbook/__init__.py
10000
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/pushover/notify.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions homeassistant/components/pvoutput/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
"documentation": "https://www.home-assistant.io/integrations/pvoutput",
"requirements": [],
"dependencies": [],
"after_dependencies": ["rest"],
"codeowners": ["@fabaff"]
}
5 changes: 5 additions & 0 deletions homeassistant/components/tesla/device_tracker.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion homeassistant/components/unifi/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"config_flow": true,
"documentation": "https://www.home-assistant.io/integrations/unifi",
"requirements": [
"aiounifi==13"
"aiounifi==14"
],
"dependencies": [],
"codeowners": [
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 = 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)
Expand Down
2 changes: 1 addition & 1 deletion requirements_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion requirements_test_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
58 changes: 37 additions & 21 deletions script/hassfest/dependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand All @@ -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")
)
)
):
Expand All @@ -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.
Expand All @@ -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",
}


Expand Down
33 changes: 33 additions & 0 deletions tests/components/logbook/test_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
0