Update pywizlight to 0.6.3 (#146490)

This commit is contained in:
Artur Pragacz 2025-06-11 08:26:55 +02:00 committed by GitHub
parent 776a014ab0
commit 33528eb6bd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 30 additions and 18 deletions

View File

@ -26,5 +26,5 @@
], ],
"documentation": "https://www.home-assistant.io/integrations/wiz", "documentation": "https://www.home-assistant.io/integrations/wiz",
"iot_class": "local_push", "iot_class": "local_push",
"requirements": ["pywizlight==0.6.2"] "requirements": ["pywizlight==0.6.3"]
} }

2
requirements_all.txt generated
View File

@ -2589,7 +2589,7 @@ pywemo==1.4.0
pywilight==0.0.74 pywilight==0.0.74
# homeassistant.components.wiz # homeassistant.components.wiz
pywizlight==0.6.2 pywizlight==0.6.3
# homeassistant.components.wmspro # homeassistant.components.wmspro
pywmspro==0.2.2 pywmspro==0.2.2

View File

@ -2144,7 +2144,7 @@ pywemo==1.4.0
pywilight==0.0.74 pywilight==0.0.74
# homeassistant.components.wiz # homeassistant.components.wiz
pywizlight==0.6.2 pywizlight==0.6.3
# homeassistant.components.wmspro # homeassistant.components.wmspro
pywmspro==0.2.2 pywmspro==0.2.2

View File

@ -80,9 +80,11 @@ async def test_rgbww_light(hass: HomeAssistant) -> None:
blocking=True, blocking=True,
) )
pilot: PilotBuilder = bulb.turn_on.mock_calls[0][1][0] pilot: PilotBuilder = bulb.turn_on.mock_calls[0][1][0]
assert pilot.pilot_params == {"b": 3, "c": 4, "g": 2, "r": 1, "state": True, "w": 5} assert pilot.pilot_params == {"b": 3, "c": 4, "g": 2, "r": 1, "w": 5}
await async_push_update(hass, bulb, {"mac": FAKE_MAC, **pilot.pilot_params}) await async_push_update(
hass, bulb, {"mac": FAKE_MAC, "state": True, **pilot.pilot_params}
)
state = hass.states.get(entity_id) state = hass.states.get(entity_id)
assert state.state == STATE_ON assert state.state == STATE_ON
assert state.attributes[ATTR_RGBWW_COLOR] == (1, 2, 3, 4, 5) assert state.attributes[ATTR_RGBWW_COLOR] == (1, 2, 3, 4, 5)
@ -95,8 +97,10 @@ async def test_rgbww_light(hass: HomeAssistant) -> None:
blocking=True, blocking=True,
) )
pilot: PilotBuilder = bulb.turn_on.mock_calls[0][1][0] pilot: PilotBuilder = bulb.turn_on.mock_calls[0][1][0]
assert pilot.pilot_params == {"dimming": 50, "temp": 6535, "state": True} assert pilot.pilot_params == {"dimming": 50, "temp": 6535}
await async_push_update(hass, bulb, {"mac": FAKE_MAC, **pilot.pilot_params}) await async_push_update(
hass, bulb, {"mac": FAKE_MAC, "state": True, **pilot.pilot_params}
)
state = hass.states.get(entity_id) state = hass.states.get(entity_id)
assert state.state == STATE_ON assert state.state == STATE_ON
assert state.attributes[ATTR_COLOR_TEMP_KELVIN] == 6535 assert state.attributes[ATTR_COLOR_TEMP_KELVIN] == 6535
@ -109,8 +113,10 @@ async def test_rgbww_light(hass: HomeAssistant) -> None:
blocking=True, blocking=True,
) )
pilot: PilotBuilder = bulb.turn_on.mock_calls[0][1][0] pilot: PilotBuilder = bulb.turn_on.mock_calls[0][1][0]
assert pilot.pilot_params == {"sceneId": 1, "state": True} assert pilot.pilot_params == {"sceneId": 1}
await async_push_update(hass, bulb, {"mac": FAKE_MAC, **pilot.pilot_params}) await async_push_update(
hass, bulb, {"mac": FAKE_MAC, "state": True, **pilot.pilot_params}
)
state = hass.states.get(entity_id) state = hass.states.get(entity_id)
assert state.state == STATE_ON assert state.state == STATE_ON
assert state.attributes[ATTR_EFFECT] == "Ocean" assert state.attributes[ATTR_EFFECT] == "Ocean"
@ -123,7 +129,7 @@ async def test_rgbww_light(hass: HomeAssistant) -> None:
blocking=True, blocking=True,
) )
pilot: PilotBuilder = bulb.turn_on.mock_calls[0][1][0] pilot: PilotBuilder = bulb.turn_on.mock_calls[0][1][0]
assert pilot.pilot_params == {"state": True} assert pilot.pilot_params == {}
async def test_rgbw_light(hass: HomeAssistant) -> None: async def test_rgbw_light(hass: HomeAssistant) -> None:
@ -137,9 +143,11 @@ async def test_rgbw_light(hass: HomeAssistant) -> None:
blocking=True, blocking=True,
) )
pilot: PilotBuilder = bulb.turn_on.mock_calls[0][1][0] pilot: PilotBuilder = bulb.turn_on.mock_calls[0][1][0]
assert pilot.pilot_params == {"b": 3, "g": 2, "r": 1, "state": True, "w": 4} assert pilot.pilot_params == {"b": 3, "g": 2, "r": 1, "w": 4}
await async_push_update(hass, bulb, {"mac": FAKE_MAC, **pilot.pilot_params}) await async_push_update(
hass, bulb, {"mac": FAKE_MAC, "state": True, **pilot.pilot_params}
)
state = hass.states.get(entity_id) state = hass.states.get(entity_id)
assert state.state == STATE_ON assert state.state == STATE_ON
assert state.attributes[ATTR_RGBW_COLOR] == (1, 2, 3, 4) assert state.attributes[ATTR_RGBW_COLOR] == (1, 2, 3, 4)
@ -152,7 +160,7 @@ async def test_rgbw_light(hass: HomeAssistant) -> None:
blocking=True, blocking=True,
) )
pilot: PilotBuilder = bulb.turn_on.mock_calls[0][1][0] pilot: PilotBuilder = bulb.turn_on.mock_calls[0][1][0]
assert pilot.pilot_params == {"dimming": 50, "temp": 6535, "state": True} assert pilot.pilot_params == {"dimming": 50, "temp": 6535}
async def test_turnable_light(hass: HomeAssistant) -> None: async def test_turnable_light(hass: HomeAssistant) -> None:
@ -166,9 +174,11 @@ async def test_turnable_light(hass: HomeAssistant) -> None:
blocking=True, blocking=True,
) )
pilot: PilotBuilder = bulb.turn_on.mock_calls[0][1][0] pilot: PilotBuilder = bulb.turn_on.mock_calls[0][1][0]
assert pilot.pilot_params == {"dimming": 50, "temp": 6535, "state": True} assert pilot.pilot_params == {"dimming": 50, "temp": 6535}
await async_push_update(hass, bulb, {"mac": FAKE_MAC, **pilot.pilot_params}) await async_push_update(
hass, bulb, {"mac": FAKE_MAC, "state": True, **pilot.pilot_params}
)
state = hass.states.get(entity_id) state = hass.states.get(entity_id)
assert state.state == STATE_ON assert state.state == STATE_ON
assert state.attributes[ATTR_COLOR_TEMP_KELVIN] == 6535 assert state.attributes[ATTR_COLOR_TEMP_KELVIN] == 6535
@ -187,9 +197,11 @@ async def test_old_firmware_dimmable_light(hass: HomeAssistant) -> None:
blocking=True, blocking=True,
) )
pilot: PilotBuilder = bulb.turn_on.mock_calls[0][1][0] pilot: PilotBuilder = bulb.turn_on.mock_calls[0][1][0]
assert pilot.pilot_params == {"dimming": 50, "state": True} assert pilot.pilot_params == {"dimming": 50}
await async_push_update(hass, bulb, {"mac": FAKE_MAC, **pilot.pilot_params}) await async_push_update(
hass, bulb, {"mac": FAKE_MAC, "state": True, **pilot.pilot_params}
)
state = hass.states.get(entity_id) state = hass.states.get(entity_id)
assert state.state == STATE_ON assert state.state == STATE_ON
assert state.attributes[ATTR_BRIGHTNESS] == 128 assert state.attributes[ATTR_BRIGHTNESS] == 128
@ -202,4 +214,4 @@ async def test_old_firmware_dimmable_light(hass: HomeAssistant) -> None:
blocking=True, blocking=True,
) )
pilot: PilotBuilder = bulb.turn_on.mock_calls[0][1][0] pilot: PilotBuilder = bulb.turn_on.mock_calls[0][1][0]
assert pilot.pilot_params == {"dimming": 100, "state": True} assert pilot.pilot_params == {"dimming": 100}