Skip to content

Commit 7cbb818

Browse files
authored
Merge pull request #25819 from home-assistant/rc
0.97.1
2 parents dffdbda + 77d984e commit 7cbb818

File tree

17 files changed

+78
-47
lines changed

17 files changed

+78
-47
lines changed

Dockerfile

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ LABEL maintainer="Paulus Schoutsen <[email protected]>"
1313
#ENV INSTALL_SSOCR no
1414
#ENV INSTALL_DLIB no
1515
#ENV INSTALL_IPERF3 no
16+
#ENV INSTALL_LOCALES no
1617

1718
VOLUME /config
1819

homeassistant/components/cisco_mobility_express/manifest.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"name": "Cisco mobility express",
44
"documentation": "https://www.home-assistant.io/components/cisco_mobility_express",
55
"requirements": [
6-
"ciscomobilityexpress==0.3.1"
6+
"ciscomobilityexpress==0.3.3"
77
],
88
"dependencies": [],
99
"codeowners": ["@fbradyirl"]

homeassistant/components/deconz/gateway.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,12 @@ def master(self) -> bool:
6363
@property
6464
def allow_clip_sensor(self) -> bool:
6565
"""Allow loading clip sensor from gateway."""
66-
return self.config_entry.data.get(CONF_ALLOW_CLIP_SENSOR, True)
66+
return self.config_entry.options.get(CONF_ALLOW_CLIP_SENSOR, True)
6767

6868
@property
6969
def allow_deconz_groups(self) -> bool:
7070
"""Allow loading deCONZ groups from gateway."""
71-
return self.config_entry.data.get(CONF_ALLOW_DECONZ_GROUPS, True)
71+
return self.config_entry.options.get(CONF_ALLOW_DECONZ_GROUPS, True)
7272

7373
async def async_update_device_registry(self):
7474
"""Update device registry."""
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
2-
"domain": "haveibeenpwned",
3-
"name": "Haveibeenpwned",
4-
"documentation": "https://www.home-assistant.io/components/haveibeenpwned",
5-
"requirements": [],
6-
"dependencies": [],
7-
"codeowners": []
2+
"domain": "haveibeenpwned",
3+
"name": "Haveibeenpwned",
4+
"documentation": "https://www.home-assistant.io/components/haveibeenpwned",
5+
"requirements": [],
6+
"dependencies": [],
7+
"codeowners": []
88
}

homeassistant/components/haveibeenpwned/sensor.py

+13-14
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import voluptuous as vol
88

99
from homeassistant.components.sensor import PLATFORM_SCHEMA
10-
from homeassistant.const import CONF_EMAIL, ATTR_ATTRIBUTION
10+
from homeassistant.const import CONF_EMAIL, CONF_API_KEY, ATTR_ATTRIBUTION
1111
import homeassistant.helpers.config_validation as cv
1212
from homeassistant.helpers.entity import Entity
1313
from homeassistant.helpers.event import track_point_in_time
@@ -25,17 +25,21 @@
2525
MIN_TIME_BETWEEN_FORCED_UPDATES = timedelta(seconds=5)
2626
MIN_TIME_BETWEEN_UPDATES = timedelta(minutes=15)
2727

28-
URL = "https://haveibeenpwned.com/api/v2/breachedaccount/"
28+
URL = "https://haveibeenpwned.com/api/v3/breachedaccount/"
2929

3030
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
31-
{vol.Required(CONF_EMAIL): vol.All(cv.ensure_list, [cv.string])}
31+
{
32+
vol.Required(CONF_EMAIL): vol.All(cv.ensure_list, [cv.string]),
33+
vol.Required(CONF_API_KEY): cv.string,
34+
}
3235
)
3336

3437

3538
def setup_platform(hass, config, add_entities, discovery_info=None):
3639
"""Set up the HaveIBeenPwned sensor."""
3740
emails = config.get(CONF_EMAIL)
38-
data = HaveIBeenPwnedData(emails)
41+
api_key = config[CONF_API_KEY]
42+
data = HaveIBeenPwnedData(emails, api_key)
3943

4044
devices = []
4145
for email in emails:
@@ -125,13 +129,14 @@ def update(self):
125129
class HaveIBeenPwnedData:
126130
"""Class for handling the data retrieval."""
127131

128-
def __init__(self, emails):
132+
def __init__(self, emails, api_key):
129133
"""Initialize the data object."""
130134
self._email_count = len(emails)
131135
self._current_index = 0
132136
self.data = {}
133137
self._email = emails[0]
134138
self._emails = emails
139+
self._api_key = api_key
135140

136141
def set_next_email(self):
137142
"""Set the next email to be looked up."""
@@ -146,16 +151,10 @@ def update_no_throttle(self):
146151
def update(self, **kwargs):
147152
"""Get the latest data for current email from REST service."""
148153
try:
149-
url = "{}{}".format(URL, self._email)
150-
154+
url = "{}{}?truncateResponse=false".format(URL, self._email)
155+
header = {USER_AGENT: HA_USER_AGENT, "hibp-api-key": self._api_key}
151156
_LOGGER.debug("Checking for breaches for email: %s", self._email)
152-
153-
req = requests.get(
154-
url,
155-
headers={USER_AGENT: HA_USER_AGENT},
156-
allow_redirects=True,
157-
timeout=5,
158-
)
157+
req = requests.get(url, headers=header, allow_redirects=True, timeout=5)
159158

160159
except requests.exceptions.RequestException:
161160
_LOGGER.error("Failed fetching data for %s", self._email)

homeassistant/components/smartthings/light.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,9 @@ async def async_update(self):
133133
"""Update entity attributes when the device status has changed."""
134134
# Brightness and transition
135135
if self._supported_features & SUPPORT_BRIGHTNESS:
136-
self._brightness = convert_scale(self._device.status.level, 100, 255)
136+
self._brightness = int(
137+
convert_scale(self._device.status.level, 100, 255, 0)
138+
)
137139
# Color Temperature
138140
if self._supported_features & SUPPORT_COLOR_TEMP:
139141
self._color_temp = color_util.color_temperature_kelvin_to_mired(

homeassistant/components/unifi/device_tracker.py

-7
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,7 @@
4141

4242
DEVICE_ATTRIBUTES = [
4343
"_is_guest_by_uap",
44-
"ap_mac",
4544
"authorized",
46-
"bssid",
47-
"ccq",
48-
"channel",
4945
"essid",
5046
"hostname",
5147
"ip",
@@ -54,14 +50,11 @@
5450
"is_wired",
5551
"mac",
5652
"name",
57-
"noise",
5853
"noted",
5954
"oui",
6055
"qos_policy_applied",
6156
"radio",
6257
"radio_proto",
63-
"rssi",
64-
"signal",
6558
"site_id",
6659
"vlan",
6760
]

homeassistant/const.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"""Constants used by Home Assistant components."""
33
MAJOR_VERSION = 0
44
MINOR_VERSION = 97
5-
PATCH_VERSION = "0"
5+
PATCH_VERSION = "1"
66
__short_version__ = "{}.{}".format(MAJOR_VERSION, MINOR_VERSION)
77
__version__ = "{}.{}".format(__short_version__, PATCH_VERSION)
88
REQUIRED_PYTHON_VER = (3, 6, 0)

requirements_all.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ buienradar==1.0.1
321321
caldav==0.6.1
322322

323323
# homeassistant.components.cisco_mobility_express
324-
ciscomobilityexpress==0.3.1
324+
ciscomobilityexpress==0.3.3
325325

326326
# homeassistant.components.ciscospark
327327
ciscosparkapi==0.4.2

tests/components/deconz/test_binary_sensor.py

+7-3
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,17 @@
3131

3232

3333
ENTRY_CONFIG = {
34-
deconz.const.CONF_ALLOW_CLIP_SENSOR: True,
35-
deconz.const.CONF_ALLOW_DECONZ_GROUPS: True,
3634
deconz.config_flow.CONF_API_KEY: "ABCDEF",
3735
deconz.config_flow.CONF_BRIDGEID: "0123456789",
3836
deconz.config_flow.CONF_HOST: "1.2.3.4",
3937
deconz.config_flow.CONF_PORT: 80,
4038
}
4139

40+
ENTRY_OPTIONS = {
41+
deconz.const.CONF_ALLOW_CLIP_SENSOR: True,
42+
deconz.const.CONF_ALLOW_DECONZ_GROUPS: True,
43+
}
44+
4245

4346
async def setup_gateway(hass, data, allow_clip_sensor=True):
4447
"""Load the deCONZ binary sensor platform."""
@@ -47,7 +50,7 @@ async def setup_gateway(hass, data, allow_clip_sensor=True):
4750
loop = Mock()
4851
session = Mock()
4952

50-
ENTRY_CONFIG[deconz.const.CONF_ALLOW_CLIP_SENSOR] = allow_clip_sensor
53+
ENTRY_OPTIONS[deconz.const.CONF_ALLOW_CLIP_SENSOR] = allow_clip_sensor
5154

5255
config_entry = config_entries.ConfigEntry(
5356
1,
@@ -56,6 +59,7 @@ async def setup_gateway(hass, data, allow_clip_sensor=True):
5659
ENTRY_CONFIG,
5760
"test",
5861
config_entries.CONN_CLASS_LOCAL_PUSH,
62+
ENTRY_OPTIONS,
5963
)
6064
gateway = deconz.DeconzGateway(hass, config_entry)
6165
gateway.api = DeconzSession(loop, session, **config_entry.data)

tests/components/deconz/test_climate.py

+7-3
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,17 @@
3939
}
4040

4141
ENTRY_CONFIG = {
42-
deconz.const.CONF_ALLOW_CLIP_SENSOR: True,
43-
deconz.const.CONF_ALLOW_DECONZ_GROUPS: True,
4442
deconz.config_flow.CONF_API_KEY: "ABCDEF",
4543
deconz.config_flow.CONF_BRIDGEID: "0123456789",
4644
deconz.config_flow.CONF_HOST: "1.2.3.4",
4745
deconz.config_flow.CONF_PORT: 80,
4846
}
4947

48+
ENTRY_OPTIONS = {
49+
deconz.const.CONF_ALLOW_CLIP_SENSOR: True,
50+
deconz.const.CONF_ALLOW_DECONZ_GROUPS: True,
51+
}
52+
5053

5154
async def setup_gateway(hass, data, allow_clip_sensor=True):
5255
"""Load the deCONZ sensor platform."""
@@ -59,7 +62,7 @@ async def setup_gateway(hass, data, allow_clip_sensor=True):
5962

6063
session = Mock(put=asynctest.CoroutineMock(return_value=response))
6164

62-
ENTRY_CONFIG[deconz.const.CONF_ALLOW_CLIP_SENSOR] = allow_clip_sensor
65+
ENTRY_OPTIONS[deconz.const.CONF_ALLOW_CLIP_SENSOR] = allow_clip_sensor
6366

6467
config_entry = config_entries.ConfigEntry(
6568
1,
@@ -68,6 +71,7 @@ async def setup_gateway(hass, data, allow_clip_sensor=True):
6871
ENTRY_CONFIG,
6972
"test",
7073
config_entries.CONN_CLASS_LOCAL_PUSH,
74+
ENTRY_OPTIONS,
7175
)
7276
gateway = deconz.DeconzGateway(hass, config_entry)
7377
gateway.api = DeconzSession(hass.loop, session, **config_entry.data)

tests/components/deconz/test_light.py

+7-3
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,17 @@
6262

6363

6464
ENTRY_CONFIG = {
65-
deconz.const.CONF_ALLOW_CLIP_SENSOR: True,
66-
deconz.const.CONF_ALLOW_DECONZ_GROUPS: True,
6765
deconz.config_flow.CONF_API_KEY: "ABCDEF",
6866
deconz.config_flow.CONF_BRIDGEID: "0123456789",
6967
deconz.config_flow.CONF_HOST: "1.2.3.4",
7068
deconz.config_flow.CONF_PORT: 80,
7169
}
7270

71+
ENTRY_OPTIONS = {
72+
deconz.const.CONF_ALLOW_CLIP_SENSOR: True,
73+
deconz.const.CONF_ALLOW_DECONZ_GROUPS: True,
74+
}
75+
7376

7477
async def setup_gateway(hass, data, allow_deconz_groups=True):
7578
"""Load the deCONZ light platform."""
@@ -78,7 +81,7 @@ async def setup_gateway(hass, data, allow_deconz_groups=True):
7881
loop = Mock()
7982
session = Mock()
8083

81-
ENTRY_CONFIG[deconz.const.CONF_ALLOW_DECONZ_GROUPS] = allow_deconz_groups
84+
ENTRY_OPTIONS[deconz.const.CONF_ALLOW_DECONZ_GROUPS] = allow_deconz_groups
8285

8386
config_entry = config_entries.ConfigEntry(
8487
1,
@@ -87,6 +90,7 @@ async def setup_gateway(hass, data, allow_deconz_groups=True):
8790
ENTRY_CONFIG,
8891
"test",
8992
config_entries.CONN_CLASS_LOCAL_PUSH,
93+
ENTRY_OPTIONS,
9094
)
9195
gateway = deconz.DeconzGateway(hass, config_entry)
9296
gateway.api = DeconzSession(loop, session, **config_entry.data)

tests/components/deconz/test_sensor.py

+7-3
Original file line numberDiff line numberDiff line change
@@ -75,14 +75,17 @@
7575

7676

7777
ENTRY_CONFIG = {
78-
deconz.const.CONF_ALLOW_CLIP_SENSOR: True,
79-
deconz.const.CONF_ALLOW_DECONZ_GROUPS: True,
8078
deconz.config_flow.CONF_API_KEY: "ABCDEF",
8179
deconz.config_flow.CONF_BRIDGEID: "0123456789",
8280
deconz.config_flow.CONF_HOST: "1.2.3.4",
8381
deconz.config_flow.CONF_PORT: 80,
8482
}
8583

84+
ENTRY_OPTIONS = {
85+
deconz.const.CONF_ALLOW_CLIP_SENSOR: True,
86+
deconz.const.CONF_ALLOW_DECONZ_GROUPS: True,
87+
}
88+
8689

8790
async def setup_gateway(hass, data, allow_clip_sensor=True):
8891
"""Load the deCONZ sensor platform."""
@@ -91,7 +94,7 @@ async def setup_gateway(hass, data, allow_clip_sensor=True):
9194
loop = Mock()
9295
session = Mock()
9396

94-
ENTRY_CONFIG[deconz.const.CONF_ALLOW_CLIP_SENSOR] = allow_clip_sensor
97+
ENTRY_OPTIONS[deconz.const.CONF_ALLOW_CLIP_SENSOR] = allow_clip_sensor
9598

9699
config_entry = config_entries.ConfigEntry(
97100
1,
@@ -100,6 +103,7 @@ async def setup_gateway(hass, data, allow_clip_sensor=True):
100103
ENTRY_CONFIG,
101104
"test",
102105
config_entries.CONN_CLASS_LOCAL_PUSH,
106+
ENTRY_OPTIONS,
103107
)
104108
gateway = deconz.DeconzGateway(hass, config_entry)
105109
gateway.api = DeconzSession(loop, session, **config_entry.data)

tests/components/smartthings/test_light.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ async def test_entity_state(hass, light_devices):
8484
state.attributes[ATTR_SUPPORTED_FEATURES]
8585
== SUPPORT_BRIGHTNESS | SUPPORT_TRANSITION
8686
)
87+
assert isinstance(state.attributes[ATTR_BRIGHTNESS], int)
8788
assert state.attributes[ATTR_BRIGHTNESS] == 255
8889

8990
# Color Dimmer 1
@@ -103,6 +104,7 @@ async def test_entity_state(hass, light_devices):
103104
)
104105
assert state.attributes[ATTR_BRIGHTNESS] == 255
105106
assert state.attributes[ATTR_HS_COLOR] == (273.6, 55.0)
107+
assert isinstance(state.attributes[ATTR_COLOR_TEMP], int)
106108
assert state.attributes[ATTR_COLOR_TEMP] == 222
107109

108110

@@ -191,7 +193,7 @@ async def test_turn_on_with_brightness(hass, light_devices):
191193
assert state is not None
192194
assert state.state == "on"
193195
# round-trip rounding error (expected)
194-
assert state.attributes[ATTR_BRIGHTNESS] == 73.95
196+
assert state.attributes[ATTR_BRIGHTNESS] == 74
195197

196198

197199
async def test_turn_on_with_minimal_brightness(hass, light_devices):
@@ -216,7 +218,7 @@ async def test_turn_on_with_minimal_brightness(hass, light_devices):
216218
assert state is not None
217219
assert state.state == "on"
218220
# round-trip rounding error (expected)
219-
assert state.attributes[ATTR_BRIGHTNESS] == 2.55
221+
assert state.attributes[ATTR_BRIGHTNESS] == 3
220222

221223

222224
async def test_turn_on_with_color(hass, light_devices):

virtualization/Docker/Dockerfile.dev

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ LABEL maintainer="Paulus Schoutsen <[email protected]>"
1414
#ENV INSTALL_SSOCR no
1515
#ENV INSTALL_DLIB no
1616
#ENV INSTALL_IPERF3 no
17+
#ENV INSTALL_LOCALES no
1718

1819
VOLUME /config
1920

virtualization/Docker/scripts/locales

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/bash
2+
# Sets up locales.
3+
4+
# Stop on errors
5+
set -e
6+
7+
apt-get update
8+
apt-get install -y --no-install-recommends locales
9+
10+
# Set the locale
11+
sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen
12+
locale-gen

virtualization/Docker/setup_docker_prereqs

+5
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ INSTALL_OPENALPR="${INSTALL_OPENALPR:-yes}"
99
INSTALL_LIBCEC="${INSTALL_LIBCEC:-yes}"
1010
INSTALL_SSOCR="${INSTALL_SSOCR:-yes}"
1111
INSTALL_DLIB="${INSTALL_DLIB:-yes}"
12+
INSTALL_LOCALES="${INSTALL_LOCALES:-yes}"
1213

1314
# Required debian packages for running hass or components
1415
PACKAGES=(
@@ -70,6 +71,10 @@ if [ "$INSTALL_DLIB" == "yes" ]; then
7071
pip3 install --no-cache-dir "dlib>=19.5"
7172
fi
7273

74+
if [ "$INSTALL_LOCALES" == "yes" ]; then
75+
virtualization/Docker/scripts/locales
76+
fi
77+
7378
# Remove packages
7479
apt-get remove -y --purge ${PACKAGES_DEV[@]}
7580
apt-get -y --purge autoremove

0 commit comments

Comments
 (0)