Skip to content

Releases: custom-components/pyscript

Pyscript 2.1.0 release

Choose a tag to compare

@craigbarratt craigbarratt released this 11 Aug 17:35

The 2.1.0 release supports HASS 2026.5+.

This release adds several new features and bug fixes, primarily to the webhook and timing decorators.

Thanks to @dmamelin for the significant contributions in this release!

Summary of changes:

  • Added hold_off_send_last option to @time_active to send the most recent suppressed trigger after the hold-off period elapses (PR #844 from @dmamelin)
  • Reworked the webhook subsystem and added a @webhook_handler decorator, normalized the methods kwarg, and raised on conflicting @webhook_trigger registrations (PR #856 from @dmamelin)
  • Exposed the aiohttp request object to @webhook_trigger functions (PR #842 from @JayNewstrom)
  • Fixed state trigger hold being reset by unrelated state updates (PR #847 from @dmamelin)
  • Fixed get_astral_location deprecation warning (PR #859 from @dmamelin)
  • Fixed task.wait_until to support legacy positional args and defaulted the time_trigger cycle task to None (PR #841 from @dmamelin)
  • Return the Jupyter kernel ports via the service response instead of a state variable; the legacy state_var path is retained for backward compatibility with older kernel clients (PR #851 from @devsnek)
  • Cleaned up IDE stub type generation (PR #863 from @contagon)
  • Documentation and test updates

The release includes contributions from @dmamelin, @JayNewstrom, @devsnek, and @contagon. Thanks to everyone who contributed PRs and reported issues.

Enjoy!

Pyscript 2.0.1 release

Choose a tag to compare

@craigbarratt craigbarratt released this 07 May 06:00

Pyscript 2.0.1 is a minor bug fix release (see #837 by @dmamelin):

  • minor fixes to @webhook_trigger to match legacy behavior
  • improved error messages for exceptions in triggered functions

Enjoy!

Pyscript 2.0.0 release

Choose a tag to compare

@craigbarratt craigbarratt released this 02 May 22:33

The 2.0.0 release supports HASS 2026.5+, and is backward compatible with earlier versions.

This release has a major refactoring of the decorator subsystem, plus compatibility updates and bug fixes.

Thanks to @dmamelin for the significant contributions and improvements in this release!

The major change is a new decorator manager that replaces the monolithic decorator implementation with a modular architecture organized by decorator type (state, event, timing, service, mqtt, webhook, task). The new implementation is the default; if you encounter a regression you can temporarily set legacy_decorators: true in your pyscript configuration to revert to the prior behavior while filing a bug report. The legacy code will be removed in a future version.

There are no intentional breaking changes.

Summary of changes:

  • Refactored decorator subsystem into a modular decorator manager (PR #818 from @dmamelin); also see #795
  • Added legacy_decorators config option to revert to the prior decorator implementation if issues are discovered (PR #818 from @dmamelin)
  • Significantly improved internal error handling for more accurate error messages and tracebacks (PR #813 from @dmamelin)
  • Fixed regression in legacy trigger expressions (PR #823 from @dmamelin)
  • Fixed AST slice handling (PR #816 from @dmamelin)
  • Fixed EvalFuncVar binding via descriptor (PR #790 from @dmamelin)
  • Fixed module context starting before Home Assistant is ready (PR #785 from @dmamelin)
  • Migrated linting from black/isort/flake8/bandit to ruff (PR #805 from @dmamelin)
  • Documented reload limitation when using legacy_decorators (PR #822 from @dmamelin)
  • Added HA 2026.5 compatibility for StateVal helpers, with backward compatibility for older HA versions, and support for Python 3.14 (PR #828 from @dmamelin)
  • Added webhook_trigger IDE stub (PR #825 from @nolsto)
  • Added support for None as hold_off in time_active and watch in state_trigger (PR #822 from @dmamelin)
  • Documentation updates

The release includes contributions from @dmamelin, @nolsto, and @mefranklin6. Thanks to everyone who contributed PRs and reported issues.

Enjoy!

Pyscript 1.7.0 release

Choose a tag to compare

@craigbarratt craigbarratt released this 09 Dec 00:23

The 1.7.0 release has several new features:

  • IDE stubs generator service for IDE support (see docs)
  • Enhanced class features (dataclass, enum, metaclass support)
  • StateVal conversion helpers and callable checks
  • MQTT retain flag and encoding support
  • Turkish translation
  • last_reported attribute for state variables

There are two minor breaking changes (hopefully unlikely for everyone):

  • Imports whose top-level package is stubs (i.e., anything below modules/stubs) are ignored at runtime, which allows you to store IDE helper modules there without affecting execution. If you have a real import called stubs you will have to rename it.
  • The period time trigger without a date in the 3rd argument now uses the date from the first argument as the default

Summary of changes:

  • Added IDE stubs generator service for better IDE support (PR #771 from @dmamelin)
  • Improved class loading to support dataclass, enum, metaclass, keywords, etc. (PR #778 from @dmamelin)
  • Added StateVal conversion helpers and availability checks (PR #769 from @dmamelin)
  • Added StateVal callable check in State.exist (PR #770 from @dmamelin)
  • Added MQTT retain flag handling to pyscript trigger and message handler (PR #755 from @3735943886)
  • Added encoding support for mqtt_trigger (PR #781 from @3735943886)
  • Added Turkish translation (PR #779 from @muminkoykiran)
  • Added last_reported to state attributes (PR #743 from @Michael-CGN)
  • Fixed @task_unique function arg (issue #761)
  • Fixed state_changed event listening to not defer until HA has started (PR #751 from @rumpeltux, fixes #750)
  • Updated period time trigger to use the date from the first argument as the default date for the 3rd argument if it is just a time
  • Full traceback now shown at debug level
  • Documentation updates

The release includes contributions from @dmamelin, @3735943886, @muminkoykiran, @rumpeltux, and @Michael-CGN. Thanks to everyone who contributed PRs and reported issues.

Enjoy!

Pyscript 1.6.4 release

Choose a tag to compare

@craigbarratt craigbarratt released this 13 Apr 19:09

This is a bug fix release that fixes another issue in 1.6.4 with await on a future, which got broken in 1.6.2.

This fixes #712. Thanks for the reporting the issue, and testing the fix.

Pyscript 1.6.3 release

Choose a tag to compare

@craigbarratt craigbarratt released this 24 Mar 22:16

This is a bug fix release that fixes an issue in 1.6.2 with await on a method.

This fixes #710. Thanks for the reporting the issue, and testing the fix.

Pyscript 1.6.2 release

Choose a tag to compare

@craigbarratt craigbarratt released this 19 Mar 22:13

The 1.6.2 release supports HASS 2025.3.3.

This release has several updates and bug fixes.

  • added state.exist to check whether entity_id exists (PR #634 from @ALERTua)
  • fix ConfigType import for HA2024.11 (PR #651 from @rccoleman)
  • fixed NameError with inner function variable shadowing (see #683 from @rtimush)
  • removed 2nd await to fix #643 and #673 (PR #688 from @dmamelin)
  • attempts to fix config flow warnings (PR #702 from @LucidityCrash)
  • python version bumped to 3.13 and various requirement versions updated
  • doc updates for @mqtt_trigger wildcards and example (PRs #677 and #680 from @larsimmisch)
  • doc updates (PR #626 from @ALERTua)
  • doc updates for @mqtt_trigger and lambda (PR #707 from @dfries)
  • doc updates (PR #708 from @BastiaanBergman)
  • doc updates around race conditions, limitations on defining async functions, blocking code, and avoiding lazy loading packages like pytz

Thanks to everyone who contributed PRs and reported issues.

Enjoy!

Pyscript 1.6.1 release

Choose a tag to compare

@craigbarratt craigbarratt released this 28 Jul 01:54

The 1.6.1 release fixes auto-reload, which was broken in the 1.6.0 release. See #622.

Pyscript 1.6.0 release

Choose a tag to compare

@craigbarratt craigbarratt released this 27 Jul 00:49

The 1.6.0 release supports HASS 2024.7.

This release has several updates and bug fixes.

  • Kwargs in triggers no longer affected by kwargs from previous triggers (see #512 from @rajeee and #516 from @ALERTua)
  • Ignore benign error message when local variables are deleted after list comprehension (PR #535 from @akonradi)
  • Added support for annotated assignment (ast_annassign); (see #537 from @binaryaaron)
  • Added support for positional-only function arguments
  • Fixed DST handling for cron time triggers
  • Add virtual attribute StateVal.entity_id (PR #555 from @dmamelin)
  • Fix for async with without target (see #581 and PR #581 from @dmamelin)
  • Add new webhook trigger (PR #592 from @contagon)
  • Updated croniter version to 2.0.2 (PR #595 from @ALERTua)
  • Support python 3.12 and resolve issue with blocking sunset/sunrise calls (PR #610 from @IgnusG)
  • Doc updates from @rodneybetts (PR #549) and @amckenny (PR #615)
  • Moved watchdog to its own thread to avoid blocking the event loop

Thanks to everyone who contributed PRs and reported issues.

Enjoy!

Pyscript 1.5.0 release

Choose a tag to compare

@craigbarratt craigbarratt released this 30 Jul 17:29

The 1.5.0 release supports the HASS 2023.7 and 2023.8 beta releases, and should be backward compatible with older versions.

This release has several updates and bug fixes:

  • Service calls no longer support the optional limit keyword timeout argument (when blocking=True), since it was removed in HASS 2023.7.
  • Added translations/de.json language file (see #462 from @anwirs).
  • Boolean or now returns False not 0 when subexpressions are False (see issue #469 from @redlefloh).
  • Directly access hass.data[DATA_RESTORE_STATE] to avoid deprecated api; this is a hack and I need a better fix (see #473 from @slomanl1).
  • Added support for service responses (see #495 from @matzman666).
  • Fix import of HASS Event following change to 2023.8 beta (see #500 from @rccoleman).
  • Log warning if user calls time.sleep(), which blocks, and call asyncio.sleep() instead.
  • Bump the required version of the watchdog module to 2.3.1, which matches the required version in the folder_watcher integration in 2023.7.
  • Bump Python to version to 3.11 for tests, and updated various versions of packages.

Thanks to everyone who contributed PRs and reported issues.

Enjoy!