mirror of
https://github.com/home-assistant/core.git
synced 2025-07-24 05:37:44 +00:00
Bump aioesphomeapi to 31.0.1 (#144939)
This commit is contained in:
parent
9a0fed89bd
commit
301ca88f41
@ -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
2
requirements_all.txt
generated
@ -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
|
||||
|
2
requirements_test_all.txt
generated
2
requirements_test_all.txt
generated
@ -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
|
||||
|
@ -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,
|
||||
|
Loading…
x
Reference in New Issue
Block a user