Hello Everyone -
It’s been a while since we have had a release but we’ve been working hard behind the scenes, and are now ready to beta the next major release of AppDaemon. As usual for a major release, there will be some breaking changes, so check the release notes and the docs. We have been using this version for quite a while without issues and think we have squashed most bugs, but as always, this is BETA code, so take care, and let us know if you run into any issues.
There are too many things to talk about here, but some of the highlights are:
- A new threading model that prevents concurrency and reentrent code execution
- Rewritten scheduler that is timezone aware and has microsecond resolution
- New programming model for easier multiple plugin usage
- User defined logs and log formats
- User defined, persistent namespaces
- Initial version of the Administration Interface
- New consolidated http component
Updated docs for AD 4.0 can be found here.
Installation instructions can be found here - PyPi has a development build available, use appdaemon==4.0.0b1
Some hints and tips on upgrading can be found here.
Beta 2 Spoilers
We are still hard at work and have some good stuff for the next beta:
- A new
camera
widget that should behave better and work with a wider range of cameras - An
input_text
widget - An
input_datetime
widget - Initial support for ASYNC calls in apps
As ever, thanks to the regulars on the AppDaemon dev team:
- Rene Tode
- Odianosen Ejale
And introducing our 2 newest dev team members:
- Humberto Rodríguez Avila
- Daniel Lashua
Here is the full list of changes:
4.0.0 Beta1 08/30/2019
Features
- Apps can now use a simplified version of the import statement e.g.
import hassapi as hass
orimport mqttapi as mqtt
. The existing import method will continue to work. - Apps can now use multiple plugin APIs with the
get_plugin_api()
function - Added
ADBase
superclass for apps that want to use theget_plugin_api()
style of coding - Scheduler rewritten to be more efficiant and allow for microsecond resolution
-
listen_log()
now sends AppDaemon system messages and has the option to set a log level. - Bumped aiohttp to v3.4.4
- Added callback locking decorators
- Rearchitected the work Q to allow App pinning and avoid re-entrant and concurrent code if desired
- Implemented multiple worker Ques to avoid Head of Line blocking
- API Calls to control app pinning
- Added the
run_in_thread()
api call - with assistance fromOdianosen Ejale <https://github.com/Odianosen25>
__ - reworked log listening functions to be more robust and added the ability to have multiple callbacks per app
- Refactored plugin APIs to remove duplication
- Moved
contrain_days
from being Hass only to all app, regardless of plugin used - Added checking for overdue threads
- Added error checking for callback signatures
- Added app attributes that allows to access AD’s
config
andapps
directories within apps - Added
parse_datetime()
-
run_once()
,run_at()
andrun_daily()
now optionally takeparse_time()
orparse_datetime()
style arguments for specifying time - Refactored appdaemon.py for greater readability and easier maintenance
- Expanded on the ability to trigger
listen_state
callbacks immediately using theimmediate
flag, without need of specifing thenew
norduration
parameter. - Allowed to make use of
attribute
when using theimmediate
flag inlisten_state
- Added initial version of the Admin Interface
- Added User Defined Namespaces
- Rewrote logging to include user defined logs and formats
- Added a unified http component to handle API, ADMIN and DASBOARD access on a single port
- Added startup conditions to the HASS plugin
- Added duplicate filtering for logs
- Added standalone pidfile functionality
- Added the ability to delete an AD app generated entity from any namespace
- Added the ability to get the history of entities from HASS database
- Added the ability to force a start of the MQTT plugin, even if not connected to broker at startup
- Added the ability to set AD’s
production_mode
from within apps - Added the ability to start, stop, restart and reload apps from either other apps or REST API
- Added the ability to register app services
- Added sensors for different internal state of AD, that can be read by apps
- Added Person widget
- Much reworking of docs
- Added
register_dependency()
for dynamic dependencies in apps - Added MQTT support for setting TLS version - contributed by
Miguel <https://github.com/mdps>
__ - Added support for socketio for older tablet devices - inspired by
algirdasc <https://github.com/algirdasc>
__ andzarya <https://github.com/zarya>
__ - Added support for
default
andcopy
parameters inget_state()
api call - contributed byRobert Schindler <https://github.com/efficiosoft>
__ - added a switch to disable the encoding of every log message to ascii - contributed by
Ben Lebherz <https://github.com/benleb>
__ - Various YAML fixes and refactoring - contributed by
Rolf Schäuble <https://github.com/rschaeuble>
__ - Allow more natural addition of commandline arguments to Docker and allow spaces - contributed by
Christoph Roeder <https://github.com/brightdroid>
__ - Allowed for subscribing to MQTT events using wildcards. e.g.
homeassistant/#
- contributed byOdianosen Ejale <https://github.com/Odianosen25>
__ - Allow to specify a MQTT message to be sent when AD shutsdown cleanly e.g.
offline
- MQTT Retain setting for birth and will messages - contributed by
Clifford W. Hansen <https://github.com/cliffordwhansen>
__ - Added Note on long lived tokens for Docker users - contributed by
Bob Anderson <https://github.com/rwa>
__ - Documentation fixes - contributed by
Johann Schmitz <https://github.com/ercpe>
__ - Documentation fixes - contributed by
Brendon Baumgartner <https://github.com/bbrendon>
__ - Documentation fixes - contributed by
Quentin Favrie <https://github.com/tseho>
__ - Documentation fixes, updating and cleaning - contributed by
Humberto Rodríguez A. <https://github.com/rhumbertgz>
__ - Added the ability to set title 2 as friendly name in widgets - contributed by
Radim <https://github.com/rds76>
__ - Added the ability to listen to
state_change
events, without using listen_state() - contributed byThomas Delaet <https://github.com/thomasdelaet>
__ - APIAI updated to dialog flow - contributed by
engrbm87 <https://github.com/engrbm87>
__
Fixes
- Fixes to listen_state() oneshot function
- Fixes to listen_state() oneshot function when duration is used
- Fixes to listen_state() function when it fires even when new and old states are same
- Fixed an issue causing incorrect busy thread counts when app callbacks had exceptions
- Fixed an issue of when MQTT Plugin not connected to broker, and it holds up AD startup
- Fix to Forcast min/max in weather widget - contributed by
adipose <https://github.com/adipose>
__ - Fix climate widget docs - contributed by
Rene Tode <https://github.com/ReneTode>
__ - Fix to harmonize
units
vsunit
- contributed byRene Tode <https://github.com/ReneTode>
__ - Added missing import in sound.py example - contributed by
cclaus <https://github.com/cclauss>
__ - Fix for run_once() - contributed by
engrbm87 <https://github.com/engrbm87>
__ - Fix for onclick not working on IE11 - contributed by
jgrieger1 <https://github.com/jgrieger1>
__ - Fixed issue of AppDaemon loading all
.yaml
files, even those starting with a.
which are hidden or binary files. Contributed byfhirschmann <https://github.com/fhirschmann>
__ - Fix for error generated when a none existent schedule timer is passed to
info_timer
- Fix for
log_type
flag inlisten_log
callback - Relative paths for appdaemon’s config directory now work corrcetly
- Fix to Dialogflow after format changes
- MQTT fix to subscribing using wildcards - contributed by
Daniel Lashua <https://github.com/dlashua>
__
Breaking Changes
- appapi.py has been renamed to adbase.py, and the contained superclass ha been renamed from AppDaemon to ADBase. This should only be a breaking change if you were using unpublished interfaces!
- Time travel semantics have changed to support faster scheduling.
-
plugin_started
andplugin_stopped
now go to the appropriate namespace for the plugin and are no longer global - Apps are no longer concurrent or re-entrant by default. This is most likely a good thing.
- Changed the signature of
listen_log()
callbacks -
cancel_listen_log()
now requires a handle supplied by the initiallisten_log()
- Removed Daemonize support - please use sysctl instead
-
set_app_state()
is deprecated - useset_state()
instead and it should do the right thing -
dash_compile_on_start
now defaults to true - The
log
section of appdaemon.yaml has been deprecated and must be replaced by the newlogs
section which has a different format to allow for user defined logs and greater flexibility in formatting etc. - API no longer has a separate port, all access is configured via the new unified http component
- API has its own top level configuration section
- Some dashboard parameters moved to the
HTTP
section and renamed -
dash_compile_on_start
renamed tocompile_on_start
-
dash_force_compile
renamed toforce_compile
- Due to the new
log
parameter to allow apps to use user defined logs, any previous parameters namedlog
should be renamed - Due to a fix for
info_timer
, this function can now returnNone
if the timer handle is invalid - As a result of a change in the way AD auto generates MQTT client status topic, if not defined previously the new topic needs to be used
- In the appdaemon configuration section,
latitude
,longitude
,elevation
andtimezone
are now mandatory - MQTT client status api change from
clientConnected
tois_client_connected