pyscript version: 2.1
Home Assistant version: 2026.8.3
Description
After the latest pyscript.generate_stubs run, the generated type stub for light.turn_on() / light.<entity>.turn_on() in pyscript_generated.py no longer includes several legitimate light.turn_on service fields, for example brightness and xy_color. These fields are still valid in runtime and also per the developer docs.
This is a recent regression, my scripts calling light.turn_on(brightness=..., xy_color=...) that previously type-checked cleanly now get false-positive "no parameter named X" errors after regenerating stubs. The dynamic runtime call itself is of couse unaffected, but it makes the generated stubs misleading.
I suspect this was introduced by #863 by @contagon, because before pyscript 2.1 the stubs generation worked fine. That update reworked stub generation to iterate the state machine instead of the entity registry. Possible "advanced" fields like brightness, xy_color, hs_color, color_temp, rgbw_color, rgbww_color, white, flash, profile get filtered out while keeping the "primary" fields (brightness_pct, rgb_color, color_temp_kelvin, brightness_step_pct, effect).
Steps to reproduce
- Call the
pyscript.generate_stubs service on an instance with at least one light entity.
- Open the generated
pyscript_generated.py and find the light class / _light_state class.
- Inspect the
turn_on / toggle signatures.
Expected
turn_on/toggle should keep accepting the full set of documented light.turn_on fields, including at least:
brightness
xy_color
hs_color
color_temp
rgbw_color
rgbww_color
white
flash
profile
Another Question: What does the additional_fields=None parameter mean? I couldn'T find anything in the documentation.
pyscript version: 2.1
Home Assistant version: 2026.8.3
Description
After the latest
pyscript.generate_stubsrun, the generated type stub forlight.turn_on()/light.<entity>.turn_on()inpyscript_generated.pyno longer includes several legitimatelight.turn_onservice fields, for examplebrightnessandxy_color. These fields are still valid in runtime and also per the developer docs.This is a recent regression, my scripts calling
light.turn_on(brightness=..., xy_color=...)that previously type-checked cleanly now get false-positive "no parameter named X" errors after regenerating stubs. The dynamic runtime call itself is of couse unaffected, but it makes the generated stubs misleading.I suspect this was introduced by #863 by @contagon, because before pyscript 2.1 the stubs generation worked fine. That update reworked stub generation to iterate the state machine instead of the entity registry. Possible "advanced" fields like
brightness,xy_color,hs_color,color_temp,rgbw_color,rgbww_color,white,flash,profileget filtered out while keeping the "primary" fields (brightness_pct,rgb_color,color_temp_kelvin,brightness_step_pct,effect).Steps to reproduce
pyscript.generate_stubsservice on an instance with at least onelightentity.pyscript_generated.pyand find thelightclass /_light_stateclass.turn_on/togglesignatures.Expected
turn_on/toggleshould keep accepting the full set of documentedlight.turn_onfields, including at least:brightnessxy_colorhs_colorcolor_temprgbw_colorrgbww_colorwhiteflashprofileAnother Question: What does the
additional_fields=Noneparameter mean? I couldn'T find anything in the documentation.