home-assistant 2021.4.0

This commit is contained in:
2021-04-08 17:36:37 +02:00
parent 56df8329cd
commit 4f51d017f2
2 changed files with 44 additions and 37 deletions

View File

@@ -6,7 +6,7 @@
pkgname=home-assistant pkgname=home-assistant
pkgdesc='Open source home automation that puts local control and privacy first' pkgdesc='Open source home automation that puts local control and privacy first'
pkgver=2021.3.4 pkgver=2021.4.0
pkgrel=1 pkgrel=1
arch=(any) arch=(any)
url=https://home-assistant.io/ url=https://home-assistant.io/
@@ -56,19 +56,25 @@ source=(
home-assistant.service home-assistant.service
home-assistant-astral2.2.patch home-assistant-astral2.2.patch
) )
b2sums=('1b8b6e4d74b0be42a71e6f858c6c6fe17dc810ecdc595563e72c2dfd7c540f1c727b21525862e6094ffe3065565525f7038daddf73b599770705aec7749882fd' b2sums=('109d0783e0dae8039e4b9f5ed16722e43e241ae15d5692b1a0e70f1ab7a343af236f56a093c0e5ed22a66487625b7ff6af30e7bdec8655ce3e30e23e9d3a8683'
'0df7bbfdac09e37294ac27567e677855c72d13be3aefbd23e0a8f101cf2148302affbe9b6b586b893f77fc990f665d7b95f4916583680c06abd8f74b5cdf3da9' '0df7bbfdac09e37294ac27567e677855c72d13be3aefbd23e0a8f101cf2148302affbe9b6b586b893f77fc990f665d7b95f4916583680c06abd8f74b5cdf3da9'
'29d510f04c4daa1be51f0b4b690b0b75a72574892d0b967332b68d7cdac1a74add90867e15f3b74117d25a3163f10604d972fa2060054d9f92e7b68bd1f7ed6f') 'b37767ef48cfe25374c8791887a9e7ba76a153476f8d636c672a052b816e9db09b1b324f50c2c79c58c26e7f14dc0f9f4b75507abf1a2ac797dfb56ef37704c7')
prepare() { prepare() {
cd core-$pkgver cd core-$pkgver
patch -Np1 -i ../home-assistant-astral2.2.patch patch -Np1 -i ../home-assistant-astral2.2.patch
# get scapy from git to avoid Python issue 42580
sed 's|scapy==2.4.4|scapy @ git+https://github.com/secdev/scapy.git@46fa40fde4049ad7770481f8806c59640df24059|g' -i requirements_all.txt
# lift hard dep constraints, we'll deal with breaking changes ourselves # lift hard dep constraints, we'll deal with breaking changes ourselves
sed 's/==/>=/g' -i requirements.txt setup.py homeassistant/package_constraints.txt sed 's/==/>=/g' -i requirements.txt setup.py homeassistant/package_constraints.txt
# allow pip >= 20.3 to be used # allow pip >= 20.3 to be used
sed 's/,<20.3//g' -i requirements.txt setup.py homeassistant/package_constraints.txt sed 's/,<20.3//g' -i requirements.txt setup.py homeassistant/package_constraints.txt
# allow aiohttp >= 3.7.4 to be used
sed 's/3.7.4.post0/3.7.4/g' -i requirements.txt setup.py homeassistant/package_constraints.txt
# allow httpx >= 0.16.1 to be used
sed 's/0.17.1/0.16.1/g' -i requirements.txt setup.py homeassistant/package_constraints.txt
} }
build() { build() {

View File

@@ -1,4 +1,4 @@
From c50af6847944e591d0e5dd8760f139b2bb3da33e Mon Sep 17 00:00:00 2001 From ede2002cfed3119cc67f96b5c409440c2730d790 Mon Sep 17 00:00:00 2001
From: Giovanni Harting <539@idlegandalf.com> From: Giovanni Harting <539@idlegandalf.com>
Date: Mon, 22 Mar 2021 18:35:14 +0100 Date: Mon, 22 Mar 2021 18:35:14 +0100
Subject: [PATCH] bump astral to 2.2 Subject: [PATCH] bump astral to 2.2
@@ -13,7 +13,7 @@ Subject: [PATCH] bump astral to 2.2
6 files changed, 47 insertions(+), 34 deletions(-) 6 files changed, 47 insertions(+), 34 deletions(-)
diff --git a/homeassistant/components/moon/sensor.py b/homeassistant/components/moon/sensor.py diff --git a/homeassistant/components/moon/sensor.py b/homeassistant/components/moon/sensor.py
index 9e0f8ef51d..9b29b071ee 100644 index 4b373469cc..6213e218d2 100644
--- a/homeassistant/components/moon/sensor.py --- a/homeassistant/components/moon/sensor.py
+++ b/homeassistant/components/moon/sensor.py +++ b/homeassistant/components/moon/sensor.py
@@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
@@ -22,8 +22,8 @@ index 9e0f8ef51d..9b29b071ee 100644
+from astral import moon +from astral import moon
import voluptuous as vol import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA from homeassistant.components.sensor import PLATFORM_SCHEMA, SensorEntity
@@ -49,7 +49,6 @@ class MoonSensor(Entity): @@ -48,7 +48,6 @@ class MoonSensor(SensorEntity):
"""Initialize the moon sensor.""" """Initialize the moon sensor."""
self._name = name self._name = name
self._state = None self._state = None
@@ -31,14 +31,14 @@ index 9e0f8ef51d..9b29b071ee 100644
@property @property
def name(self): def name(self):
@@ -88,4 +87,4 @@ class MoonSensor(Entity): @@ -87,4 +86,4 @@ class MoonSensor(SensorEntity):
async def async_update(self): async def async_update(self):
"""Get the time and updates the states.""" """Get the time and updates the states."""
today = dt_util.as_local(dt_util.utcnow()).date() today = dt_util.as_local(dt_util.utcnow()).date()
- self._state = self._astral.moon_phase(today) - self._state = self._astral.moon_phase(today)
+ self._state = moon.phase(today) + self._state = moon.phase(today)
diff --git a/homeassistant/components/sun/__init__.py b/homeassistant/components/sun/__init__.py diff --git a/homeassistant/components/sun/__init__.py b/homeassistant/components/sun/__init__.py
index 2d921da4a4..ec8f4b325a 100644 index dfe3b15c11..489eab6b5b 100644
--- a/homeassistant/components/sun/__init__.py --- a/homeassistant/components/sun/__init__.py
+++ b/homeassistant/components/sun/__init__.py +++ b/homeassistant/components/sun/__init__.py
@@ -92,6 +92,7 @@ class Sun(Entity): @@ -92,6 +92,7 @@ class Sun(Entity):
@@ -115,19 +115,19 @@ index 2d921da4a4..ec8f4b325a 100644
_LOGGER.debug( _LOGGER.debug(
diff --git a/homeassistant/helpers/sun.py b/homeassistant/helpers/sun.py diff --git a/homeassistant/helpers/sun.py b/homeassistant/helpers/sun.py
index 2b82e19b8c..a4c16833e4 100644 index b3a37d238f..f9e9b0160f 100644
--- a/homeassistant/helpers/sun.py --- a/homeassistant/helpers/sun.py
+++ b/homeassistant/helpers/sun.py +++ b/homeassistant/helpers/sun.py
@@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
from __future__ import annotations from __future__ import annotations
import datetime import datetime
-from typing import TYPE_CHECKING, Optional, Union -from typing import TYPE_CHECKING
+from typing import TYPE_CHECKING, Optional, Tuple, Union +from typing import TYPE_CHECKING, Optional, Tuple, Union
from homeassistant.const import SUN_EVENT_SUNRISE, SUN_EVENT_SUNSET from homeassistant.const import SUN_EVENT_SUNRISE, SUN_EVENT_SUNSET
from homeassistant.core import callback from homeassistant.core import HomeAssistant, callback
@@ -16,27 +16,32 @@ if TYPE_CHECKING: @@ -14,27 +14,32 @@ if TYPE_CHECKING:
DATA_LOCATION_CACHE = "astral_location_cache" DATA_LOCATION_CACHE = "astral_location_cache"
@@ -136,7 +136,7 @@ index 2b82e19b8c..a4c16833e4 100644
@callback @callback
@bind_hass @bind_hass
-def get_astral_location(hass: HomeAssistantType) -> astral.Location: -def get_astral_location(hass: HomeAssistant) -> astral.Location:
+def get_astral_location( +def get_astral_location(
+ hass: HomeAssistantType, + hass: HomeAssistantType,
+) -> Tuple["astral.location.Location", "astral.Elevation"]: +) -> Tuple["astral.location.Location", "astral.Elevation"]:
@@ -166,8 +166,8 @@ index 2b82e19b8c..a4c16833e4 100644
@callback @callback
@@ -48,26 +53,31 @@ def get_astral_event_next( @@ -46,26 +51,31 @@ def get_astral_event_next(
offset: Optional[datetime.timedelta] = None, offset: datetime.timedelta | None = None,
) -> datetime.datetime: ) -> datetime.datetime:
"""Calculate the next specified solar event.""" """Calculate the next specified solar event."""
- location = get_astral_location(hass) - location = get_astral_location(hass)
@@ -180,12 +180,12 @@ index 2b82e19b8c..a4c16833e4 100644
@callback @callback
def get_location_astral_event_next( def get_location_astral_event_next(
- location: "astral.Location", - location: astral.Location,
+ location: "astral.location.Location", + location: "astral.location.Location",
+ elevation: "astral.Elevation", + elevation: "astral.Elevation",
event: str, event: str,
utc_point_in_time: Optional[datetime.datetime] = None, utc_point_in_time: datetime.datetime | None = None,
offset: Optional[datetime.timedelta] = None, offset: datetime.timedelta | None = None,
) -> datetime.datetime: ) -> datetime.datetime:
"""Calculate the next specified solar event.""" """Calculate the next specified solar event."""
- from astral import AstralError # pylint: disable=import-outside-toplevel - from astral import AstralError # pylint: disable=import-outside-toplevel
@@ -203,7 +203,7 @@ index 2b82e19b8c..a4c16833e4 100644
mod = -1 mod = -1
while True: while True:
try: try:
@@ -75,13 +85,13 @@ def get_location_astral_event_next( @@ -73,13 +83,13 @@ def get_location_astral_event_next(
getattr(location, event)( getattr(location, event)(
dt_util.as_local(utc_point_in_time).date() dt_util.as_local(utc_point_in_time).date()
+ datetime.timedelta(days=mod), + datetime.timedelta(days=mod),
@@ -219,9 +219,9 @@ index 2b82e19b8c..a4c16833e4 100644
pass pass
mod += 1 mod += 1
@@ -94,9 +104,7 @@ def get_astral_event_date( @@ -92,9 +102,7 @@ def get_astral_event_date(
date: Union[datetime.date, datetime.datetime, None] = None, date: datetime.date | datetime.datetime | None = None,
) -> Optional[datetime.datetime]: ) -> datetime.datetime | None:
"""Calculate the astral event time for the specified date.""" """Calculate the astral event time for the specified date."""
- from astral import AstralError # pylint: disable=import-outside-toplevel - from astral import AstralError # pylint: disable=import-outside-toplevel
- -
@@ -230,7 +230,7 @@ index 2b82e19b8c..a4c16833e4 100644
if date is None: if date is None:
date = dt_util.now().date() date = dt_util.now().date()
@@ -104,9 +112,13 @@ def get_astral_event_date( @@ -102,9 +110,13 @@ def get_astral_event_date(
if isinstance(date, datetime.datetime): if isinstance(date, datetime.datetime):
date = dt_util.as_local(date).date() date = dt_util.as_local(date).date()
@@ -247,44 +247,45 @@ index 2b82e19b8c..a4c16833e4 100644
return None return None
diff --git a/homeassistant/package_constraints.txt b/homeassistant/package_constraints.txt diff --git a/homeassistant/package_constraints.txt b/homeassistant/package_constraints.txt
index 7642e14bda..534fa68211 100644 index cc8ad8f819..dd9eac5a58 100644
--- a/homeassistant/package_constraints.txt --- a/homeassistant/package_constraints.txt
+++ b/homeassistant/package_constraints.txt +++ b/homeassistant/package_constraints.txt
@@ -2,7 +2,7 @@ PyJWT==1.7.1 @@ -3,8 +3,8 @@ PyNaCl==1.3.0
PyNaCl==1.3.0 aiodiscover==1.3.3
aiohttp==3.7.4 aiohttp==3.7.4.post0
aiohttp_cors==0.7.0 aiohttp_cors==0.7.0
-astral==1.10.1 -astral==1.10.1
async-upnp-client==0.16.0
+astral==2.2 +astral==2.2
async-upnp-client==0.14.13
async_timeout==3.0.1 async_timeout==3.0.1
attrs==19.3.0 attrs==20.3.0
awesomeversion==21.2.3
diff --git a/requirements.txt b/requirements.txt diff --git a/requirements.txt b/requirements.txt
index 0a5b754dbf..e3acc1948d 100644 index 5f633eaeb6..a3facbe5ab 100644
--- a/requirements.txt --- a/requirements.txt
+++ b/requirements.txt +++ b/requirements.txt
@@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
# Home Assistant Core # Home Assistant Core
aiohttp==3.7.4 aiohttp==3.7.4.post0
-astral==1.10.1 -astral==1.10.1
+astral==2.2 +astral==2.2
async_timeout==3.0.1 async_timeout==3.0.1
attrs==19.3.0 attrs==20.3.0
awesomeversion==21.2.3 awesomeversion==21.2.3
diff --git a/setup.py b/setup.py diff --git a/setup.py b/setup.py
index ce7d6b6883..f25250dd95 100755 index 56e5639148..f74a913cb8 100755
--- a/setup.py --- a/setup.py
+++ b/setup.py +++ b/setup.py
@@ -33,7 +33,7 @@ PACKAGES = find_packages(exclude=["tests", "tests.*"]) @@ -33,7 +33,7 @@ PACKAGES = find_packages(exclude=["tests", "tests.*"])
REQUIRES = [ REQUIRES = [
"aiohttp==3.7.4", "aiohttp==3.7.4.post0",
- "astral==1.10.1", - "astral==1.10.1",
+ "astral==2.2", + "astral==2.2",
"async_timeout==3.0.1", "async_timeout==3.0.1",
"attrs==19.3.0", "attrs==20.3.0",
"awesomeversion==21.2.3", "awesomeversion==21.2.3",
-- --
2.31.0 2.31.1