Bump aioesphomeapi to 31.0.1 (#144939)

This commit is contained in:
J. Nick Koston 2025-05-14 22:27:25 -05:00 committed by GitHub
parent 9a0fed89bd
commit 301ca88f41
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 52 additions and 3 deletions

View File

@ -17,7 +17,7 @@
"mqtt": ["esphome/discover/#"],
"quality_scale": "platinum",
"requirements": [
"aioesphomeapi==31.0.0",
"aioesphomeapi==31.0.1",
"esphome-dashboard-api==1.3.0",
"bleak-esphome==2.15.1"
],

2
requirements_all.txt generated
View File

@ -241,7 +241,7 @@ aioelectricitymaps==0.4.0
aioemonitor==1.0.5
# homeassistant.components.esphome
aioesphomeapi==31.0.0
aioesphomeapi==31.0.1
# homeassistant.components.flo
aioflo==2021.11.0

View File

@ -229,7 +229,7 @@ aioelectricitymaps==0.4.0
aioemonitor==1.0.5
# homeassistant.components.esphome
aioesphomeapi==31.0.0
aioesphomeapi==31.0.1
# homeassistant.components.flo
aioflo==2021.11.0

View File

@ -204,6 +204,55 @@ async def test_light_brightness(
mock_client.light_command.reset_mock()
async def test_light_legacy_brightness(
hass: HomeAssistant,
mock_client: APIClient,
mock_generic_device_entry: MockGenericDeviceEntryType,
) -> None:
"""Test a generic light entity that only supports legacy brightness."""
mock_client.api_version = APIVersion(1, 7)
entity_info = [
LightInfo(
object_id="mylight",
key=1,
name="my light",
unique_id="my_light",
min_mireds=153,
max_mireds=400,
supported_color_modes=[LightColorCapability.BRIGHTNESS, 2],
)
]
states = [
LightState(
key=1, state=True, brightness=100, color_mode=ESPColorMode.LEGACY_BRIGHTNESS
)
]
user_service = []
await mock_generic_device_entry(
mock_client=mock_client,
entity_info=entity_info,
user_service=user_service,
states=states,
)
state = hass.states.get("light.test_mylight")
assert state is not None
assert state.state == STATE_ON
assert state.attributes[ATTR_SUPPORTED_COLOR_MODES] == [
ColorMode.BRIGHTNESS,
]
await hass.services.async_call(
LIGHT_DOMAIN,
SERVICE_TURN_ON,
{ATTR_ENTITY_ID: "light.test_mylight"},
blocking=True,
)
mock_client.light_command.assert_has_calls(
[call(key=1, state=True, color_mode=LightColorCapability.BRIGHTNESS)]
)
mock_client.light_command.reset_mock()
async def test_light_brightness_on_off(
hass: HomeAssistant,
mock_client: APIClient,