Releases: custom-components/pyscript
Pyscript 1.7.0 release
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)
StateValconversion helpers and callable checks- MQTT retain flag and encoding support
- Turkish translation
last_reportedattribute for state variables
There are two minor breaking changes (hopefully unlikely for everyone):
- Imports whose top-level package is
stubs(i.e., anything belowmodules/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
StateValconversion helpers and availability checks (PR #769 from @dmamelin) - Added
StateValcallable check inState.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_reportedto state attributes (PR #743 from @Michael-CGN) - Fixed
@task_uniquefunction arg (issue #761) - Fixed
state_changedevent 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
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
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
The 1.6.2 release supports HASS 2025.3.3.
This release has several updates and bug fixes.
- added
state.existto check whetherentity_idexists (PR #634 from @ALERTua) - fix
ConfigTypeimport for HA2024.11 (PR #651 from @rccoleman) - fixed
NameErrorwith inner function variable shadowing (see #683 from @rtimush) - removed 2nd
awaitto 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_triggerwildcards and example (PRs #677 and #680 from @larsimmisch) - doc updates (PR #626 from @ALERTua)
- doc updates for
@mqtt_triggerandlambda(PR #707 from @dfries) - doc updates (PR #708 from @BastiaanBergman)
- doc updates around race conditions, limitations on defining
asyncfunctions, blocking code, and avoiding lazy loading packages likepytz
Thanks to everyone who contributed PRs and reported issues.
Enjoy!
Pyscript 1.6.1 release
The 1.6.1 release fixes auto-reload, which was broken in the 1.6.0 release. See #622.
Pyscript 1.6.0 release
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 withwithout 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
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
limitkeyword timeout argument (whenblocking=True), since it was removed in HASS 2023.7. - Added
translations/de.jsonlanguage file (see #462 from @anwirs). - Boolean
ornow returnsFalsenot 0 when subexpressions areFalse(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
Eventfollowing 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
watchdogmodule to 2.3.1, which matches the required version in thefolder_watcherintegration 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!
Pyscript 1.4.0 release
The 1.4.0 release supports the HASS 2023.3 release.
This release has several bug fixes:
- Boolean operators (eg:
and) return correct type, not integer (see #335); reported by @ccapndave. - Fixed setting of
kwargswhenstate_hold != None(see #374, #382); reported by @jkrasinger and PR by @ALERTua. - Decorator function arguments now expand
*list(see #420); reported by @fovea1959. - Jupyter kernel interface ignores
comm_open,comm_msgandcomm_closemessages (see #390); reported by @tms320. - Fix boolean operator truth test (see #438); reported by @Kaptensanders.
- Fixed unexpected triggers by
@event_triggerdue to prior trigger variables persisting in the context's symbol table; fixed by ensuring local symbol table is overwritten by default (see #439); reported by @Michael-CGN. - Ensure user decorator functions start triggers in correct context (see #428, #457); reported by @j-steve.
- Added
translations/sk.json(see #441); PR by @misa1515. - Added
functoolstoALLOWED_IMPORTS(see #432); requested by @oxan. - Bump Python to version to 3.10 for tests, and updated various versions of packages.
- Bump the required version of the
watchdogmodule to 2.2.1, which matches the required version in thefolder_watcherintegration in 2023.6. - Update
README.mdto correct HACS URL (see #348); PR by @wrt54g). - Fix link to developer docs (see #373); PR by @robertgresock.
Enjoy!
Pyscript 1.3.3 release
The 1.3.3 release supports the HASS 2022.3 release, which has a breaking change related to the interface for entity (state) persistence.
State persistence in pyscript will not work in HASS 2022.3 if you use pyscript versions prior to 1.3.3.
This was reported by @LeszekSwirski and fixed by @dlashua (see #331). Thanks!
This release also bumps the required version of the watchdog module to 2.1.6, which matches the required version in the folder_watcher integration in 2022.3. If you run this version of pyscript with an older version of HASS, you might see a version conflict for watchdog. If so, either upgrade HASS or downgrade pyscript to 1.3.2.
There are a couple of other bug fixes since 1.3.2:
- Correctly detect inner functions instead of just at top level, reported by @LeszekSwirski (see #263).
- Ensure
once()triggers without a date that have a negative (eg,midnight - 30s) or large (more than 2 days) offset are adjusted so they happen in the next 24 hours. Previously, a negative offset or a large positive offset that were in the past or more than 2 days in the future would never trigger. Reported by @herrfrei (see #330).
Enjoy!