Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
balloob authored Mar 9, 2023
2 parents 3dca4c2 + 3fba181 commit ddde176
Show file tree
Hide file tree
Showing 15 changed files with 50 additions and 22 deletions.
5 changes: 3 additions & 2 deletions homeassistant/components/dormakaba_dkey/binary_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,10 @@ class DormakabaDkeyBinarySensorDescription(
),
DormakabaDkeyBinarySensorDescription(
key="security_locked",
name="Dead bolt",
name="Deadbolt",
device_class=BinarySensorDeviceClass.LOCK,
is_on=lambda state: state.unlock_status != UnlockStatus.SECURITY_LOCKED,
is_on=lambda state: state.unlock_status
not in (UnlockStatus.SECURITY_LOCKED, UnlockStatus.UNLOCKED_SECURITY_LOCKED),
),
)

Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/frontend/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@
"documentation": "https://www.home-assistant.io/integrations/frontend",
"integration_type": "system",
"quality_scale": "internal",
"requirements": ["home-assistant-frontend==20230306.0"]
"requirements": ["home-assistant-frontend==20230309.0"]
}
4 changes: 2 additions & 2 deletions homeassistant/components/hassio/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
r")$"
)

# Authenticated users manage backups + download logs
# Authenticated users manage backups + download logs, changelog and documentation
PATHS_ADMIN = re.compile(
r"^(?:"
r"|backups/[a-f0-9]{8}(/info|/download|/restore/full|/restore/partial)?"
Expand All @@ -66,7 +66,7 @@
r"|multicast/logs"
r"|observer/logs"
r"|supervisor/logs"
r"|addons/[^/]+/logs"
r"|addons/[^/]+/(changelog|documentation|logs)"
r")$"
)

Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/mazda/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
"iot_class": "cloud_polling",
"loggers": ["pymazda"],
"quality_scale": "platinum",
"requirements": ["pymazda==0.3.7"]
"requirements": ["pymazda==0.3.8"]
}
8 changes: 6 additions & 2 deletions homeassistant/components/mqtt/light/schema_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -495,8 +495,12 @@ def _rgbx_received(
self._attr_color_mode = color_mode
if self._topic[CONF_BRIGHTNESS_STATE_TOPIC] is None:
rgb = convert_color(*color)
percent_bright = float(color_util.color_RGB_to_hsv(*rgb)[2]) / 100.0
self._attr_brightness = min(round(percent_bright * 255), 255)
brightness = max(rgb)
self._attr_brightness = brightness
# Normalize the color to 100% brightness
color = tuple(
min(round(channel / brightness * 255), 255) for channel in color
)
return color

@callback
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/mqtt/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ def _update_state(msg: ReceiveMessage) -> None:
else:
self._attr_native_value = new_value
return
if self.device_class is None:
if self.device_class in {None, SensorDeviceClass.ENUM}:
self._attr_native_value = new_value
return
if (payload_datetime := dt_util.parse_datetime(new_value)) is None:
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/roomba/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@
"documentation": "https://www.home-assistant.io/integrations/roomba",
"iot_class": "local_push",
"loggers": ["paho_mqtt", "roombapy"],
"requirements": ["roombapy==1.6.5"]
"requirements": ["roombapy==1.6.6"]
}
2 changes: 1 addition & 1 deletion homeassistant/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
APPLICATION_NAME: Final = "HomeAssistant"
MAJOR_VERSION: Final = 2023
MINOR_VERSION: Final = 3
PATCH_VERSION: Final = "2"
PATCH_VERSION: Final = "3"
__short_version__: Final = f"{MAJOR_VERSION}.{MINOR_VERSION}"
__version__: Final = f"{__short_version__}.{PATCH_VERSION}"
REQUIRED_PYTHON_VER: Final[tuple[int, int, int]] = (3, 10, 0)
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/package_constraints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ fnvhash==0.1.0
hass-nabucasa==0.61.0
hassil==1.0.6
home-assistant-bluetooth==1.9.3
home-assistant-frontend==20230306.0
home-assistant-frontend==20230309.0
home-assistant-intents==2023.2.28
httpx==0.23.3
ifaddr==0.1.7
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "homeassistant"
version = "2023.3.2"
version = "2023.3.3"
license = {text = "Apache-2.0"}
description = "Open-source home automation platform running on Python 3."
readme = "README.rst"
Expand Down
6 changes: 3 additions & 3 deletions requirements_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -907,7 +907,7 @@ hole==0.8.0
holidays==0.18.0

# homeassistant.components.frontend
home-assistant-frontend==20230306.0
home-assistant-frontend==20230309.0

# homeassistant.components.conversation
home-assistant-intents==2023.2.28
Expand Down Expand Up @@ -1771,7 +1771,7 @@ pymailgunner==1.4
pymata-express==1.19

# homeassistant.components.mazda
pymazda==0.3.7
pymazda==0.3.8

# homeassistant.components.mediaroom
pymediaroom==0.6.5.4
Expand Down Expand Up @@ -2264,7 +2264,7 @@ rocketchat-API==0.6.1
rokuecp==0.17.1

# homeassistant.components.roomba
roombapy==1.6.5
roombapy==1.6.6

# homeassistant.components.roon
roonapi==0.1.3
Expand Down
6 changes: 3 additions & 3 deletions requirements_test_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -690,7 +690,7 @@ hole==0.8.0
holidays==0.18.0

# homeassistant.components.frontend
home-assistant-frontend==20230306.0
home-assistant-frontend==20230309.0

# homeassistant.components.conversation
home-assistant-intents==2023.2.28
Expand Down Expand Up @@ -1275,7 +1275,7 @@ pymailgunner==1.4
pymata-express==1.19

# homeassistant.components.mazda
pymazda==0.3.7
pymazda==0.3.8

# homeassistant.components.melcloud
pymelcloud==2.5.8
Expand Down Expand Up @@ -1600,7 +1600,7 @@ ring_doorbell==0.7.2
rokuecp==0.17.1

# homeassistant.components.roomba
roombapy==1.6.5
roombapy==1.6.6

# homeassistant.components.roon
roonapi==0.1.3
Expand Down
2 changes: 2 additions & 0 deletions tests/components/hassio/test_http.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,8 @@ async def test_forward_request_not_onboarded_unallowed_paths(
("backups/1234abcd/info", True),
("supervisor/logs", True),
("addons/bl_b392/logs", True),
("addons/bl_b392/changelog", True),
("addons/bl_b392/documentation", True),
],
)
async def test_forward_request_admin_get(
Expand Down
25 changes: 22 additions & 3 deletions tests/components/mqtt/test_light.py
Original file line number Diff line number Diff line change
Expand Up @@ -636,8 +636,8 @@ async def test_brightness_from_rgb_controlling_scale(
}
},
)
mqtt_mock = await mqtt_mock_entry_with_yaml_config()
await hass.async_block_till_done()
await mqtt_mock_entry_with_yaml_config()

state = hass.states.get("light.test")
assert state.state == STATE_UNKNOWN
Expand All @@ -650,10 +650,29 @@ async def test_brightness_from_rgb_controlling_scale(
state = hass.states.get("light.test")
assert state.attributes.get("brightness") == 255

async_fire_mqtt_message(hass, "test_scale_rgb/rgb/status", "127,0,0")
async_fire_mqtt_message(hass, "test_scale_rgb/rgb/status", "128,64,32")

state = hass.states.get("light.test")
assert state.attributes.get("brightness") == 128
assert state.attributes.get("rgb_color") == (255, 128, 64)

mqtt_mock.async_publish.reset_mock()
await common.async_turn_on(hass, "light.test", brightness=191)
await hass.async_block_till_done()

mqtt_mock.async_publish.assert_has_calls(
[
call("test_scale_rgb/set", "on", 0, False),
call("test_scale_rgb/rgb/set", "191,95,47", 0, False),
],
any_order=True,
)
async_fire_mqtt_message(hass, "test_scale_rgb/rgb/status", "191,95,47")
await hass.async_block_till_done()

state = hass.states.get("light.test")
assert state.attributes.get("brightness") == 127
assert state.attributes.get("brightness") == 191
assert state.attributes.get("rgb_color") == (255, 127, 63)


async def test_controlling_state_via_topic_with_templates(
Expand Down
2 changes: 2 additions & 0 deletions tests/components/mqtt/test_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@ async def test_setting_sensor_value_via_mqtt_message(
False,
),
(sensor.SensorDeviceClass.TIMESTAMP, "invalid", STATE_UNKNOWN, True),
(sensor.SensorDeviceClass.ENUM, "some_value", "some_value", False),
(None, "some_value", "some_value", False),
],
)
async def test_setting_sensor_native_value_handling_via_mqtt_message(
Expand Down

0 comments on commit ddde176

Please sign in to comment.