Announcement: AppDaemon beta 3

Other than the syntax change, I’m not sure I understand the difference between this and the previous method of defining dependencies by modules. You still specify the modules that the app depends on?

Typo, sorry. I fixed it. They should have been app1 and app2.

Per-app dependency tracking?! You are my hero! :smile:

1 Like

To get the log file name in Beta 2, I switched to

self.errorfile = self.get_error_log().handlers[0].baseFilename

which worked.

For Beta 3, this gives the error

20│2018-02-12 10:32:30.660323 WARNING AppDaemon: Unexpected initializing app: error_notifier: │gh
ts│2018-02-12 10:32:30.660710 WARNING AppDaemon: ---------------------------------------------│
20│---------------                                                                            │
00│2018-02-12 10:32:30.661425 WARNING AppDaemon: Traceback (most recent call last):           │49
  │  File "/home/homeassistant/appdaemon3/lib/python3.5/site-packages/appdaemon/appdaemon.py",│e
14│ line 1798, in check_app_updates                                                           │
  │    self.init_object(app)                                                                  │
  │  File "/home/homeassistant/appdaemon3/lib/python3.5/site-packages/appdaemon/appdaemon.py",│
  │ line 1438, in init_object                                                                 │
At│    self.objects[name]["object"].initialize()                                              │
  │  File "/home/homeassistant/testing/apps/ErrorNotifier.py", line 30, in initialize         │
20│    self.errorfile = self.get_error_log().handlers[0].baseFilename                         │--
--│AttributeError: 'function' object has no attribute 'handlers'                              │
01│2018-02-12 10:32:30.662518 WARNING AppDaemon: ---------------------------------------------│49
Fe│---------------                                                                            │

@aimc,

This is great man and thanks. But those of use that use the same name for module and app, no changes right? :grin:

This seems a bit restricting.

I have been using @turboc’s trick of overriding the logging functions every since he came up with the idea. Which means just about all my modules are dependent on another module, which can not be defined as an app.

In this case, it doesn’t matter that much, because if I change the module I might as well restart AD, but the idea that ‘apps can only be dependent on other apps’ doesn’t seem right.

Fixed in b4

OK, I’ll look at adding a way to make modules dependent upon each other as well. I was debating doing that anyway when I change to app dependencies.

1 Like

You should be fine.

@gpbenton - would you be OK with having to explicitly define a ,module that others depend on and being restricted to it not being an app?

Something like:

module_dependencies:
  global_variables:
    - module1
    - module2
  some_other_global_module:
    - module1
    - module3
    - module4

Saying that module 1 and module 2 depend on global_variables, and modules 1,2 and 3 depend on some_other_global_module.

Then if global_variables change, I stop all apps using module1 and 2, reload global_variables, reload module 1 and 2 then restart the apps.

global_variables and some_other_global_module would NOT be apps.

That seems fine.

@aimc So I put a very basic version of a standalone mqtt listener up here

https://github.com/home-assistant/appdaemon/pull/238

3 Likes

Excellent - I’ll take a look when I have a moment, I think this is an excellent addition to AppDaemon :slight_smile:

Hello @aimc,

Moved to the new update and though everything working fine so far, I have something I just wanted to know if its normal. I get a lot of logs now, when a dependency is not available or when I reload it. It’s like the module name, is split across different lines of entry for the file its dependent on. As I said not an issue, but you might want to look into it, so one’s log doesn’t get loaded so much when the main module is reloaded.

Thanks

in label widget I think the text_style is not working. I use

text_style: "color: rgb(255,255,255);font-size: 100%"

no matter what font-size I specify, the size is the same

there is a mix up somewhere it seems to be value_style inside the widget.

I need a bit more info than that - dependencies did change, I assume you have moved to the new App level dependencies? If so, can you show me your config and a sample of what you are talking about? App reloading is a little more verbose now, and I can cut back on that when I am confident things are working properly.

Hello @aimc,

I have in my apps.yaml the following and more:

weather_intent:
   module: weather_intent
   class: ProcessWeatherQuery
   dependencies: snips_core
 

news_intent:
  module: news_intent
  class: ProcessNews
  dependencies: snips_core
  api_key: <my key>
 

maths_intent:
   module: maths_intent
   class: ProcessMaths
   dependencies: snips_core
   

shopping_intent:
   module: shopping_intent
   class: ProcessShopList
   dependencies: snips_core

Now if I was to reload snips_core the following is logged:

 2018-02-13 08:03:49.425369 WARNING AppDaemon: Unable to find app s in dependencies for weather_intent
2018-02-13 08:03:49.426629 WARNING AppDaemon: Ignoring app weather_intent
2018-02-13 08:03:49.427760 WARNING AppDaemon: Unable to find app n in dependencies for weather_intent
2018-02-13 08:03:49.428890 WARNING AppDaemon: Ignoring app weather_intent
2018-02-13 08:03:49.430108 WARNING AppDaemon: Unable to find app i in dependencies for weather_intent
2018-02-13 08:03:49.431222 WARNING AppDaemon: Ignoring app weather_intent
2018-02-13 08:03:49.432553 WARNING AppDaemon: Unable to find app p in dependencies for weather_intent
2018-02-13 08:03:49.433864 WARNING AppDaemon: Ignoring app weather_intent
2018-02-13 08:03:49.434968 WARNING AppDaemon: Unable to find app s in dependencies for weather_intent
2018-02-13 08:03:49.436337 WARNING AppDaemon: Ignoring app weather_intent
2018-02-13 08:03:49.437669 WARNING AppDaemon: Unable to find app _ in dependencies for weather_intent
2018-02-13 08:03:49.438770 WARNING AppDaemon: Ignoring app weather_intent
2018-02-13 08:03:49.440251 WARNING AppDaemon: Unable to find app c in dependencies for weather_intent
2018-02-13 08:03:49.555947 WARNING AppDaemon: Ignoring app weather_intent
2018-02-13 08:03:49.556753 WARNING AppDaemon: Unable to find app o in dependencies for weather_intent
2018-02-13 08:03:49.557313 WARNING AppDaemon: Ignoring app weather_intent
2018-02-13 08:03:49.557780 WARNING AppDaemon: Unable to find app r in dependencies for weather_intent
2018-02-13 08:03:49.558531 WARNING AppDaemon: Ignoring app weather_intent
2018-02-13 08:03:49.559048 WARNING AppDaemon: Unable to find app e in dependencies for weather_intent
2018-02-13 08:03:49.559738 WARNING AppDaemon: Ignoring app weather_intent
2018-02-13 08:03:49.560408 WARNING AppDaemon: Unable to find app s in dependencies for shopping_intent
2018-02-13 08:03:49.560937 WARNING AppDaemon: Ignoring app shopping_intent
2018-02-13 08:03:49.561604 WARNING AppDaemon: Unable to find app n in dependencies for shopping_intent
2018-02-13 08:03:49.562246 WARNING AppDaemon: Ignoring app shopping_intent
2018-02-13 08:03:49.562722 WARNING AppDaemon: Unable to find app i in dependencies for shopping_intent
2018-02-13 08:03:49.563421 WARNING AppDaemon: Ignoring app shopping_intent
2018-02-13 08:03:49.563937 WARNING AppDaemon: Unable to find app p in dependencies for shopping_intent
2018-02-13 08:03:49.564570 WARNING AppDaemon: Ignoring app shopping_intent
2018-02-13 08:03:49.565305 WARNING AppDaemon: Unable to find app s in dependencies for shopping_intent
2018-02-13 08:03:49.565815 WARNING AppDaemon: Ignoring app shopping_intent
2018-02-13 08:03:49.566523 WARNING AppDaemon: Unable to find app _ in dependencies for shopping_intent
2018-02-13 08:03:49.567056 WARNING AppDaemon: Ignoring app shopping_intent
2018-02-13 08:03:49.567565 WARNING AppDaemon: Unable to find app c in dependencies for shopping_intent
2018-02-13 08:03:49.568266 WARNING AppDaemon: Ignoring app shopping_intent
2018-02-13 08:03:49.568769 WARNING AppDaemon: Unable to find app o in dependencies for shopping_intent
2018-02-13 08:03:49.569357 WARNING AppDaemon: Ignoring app shopping_intent
2018-02-13 08:03:49.569957 WARNING AppDaemon: Unable to find app r in dependencies for shopping_intent
2018-02-13 08:03:49.570651 WARNING AppDaemon: Ignoring app shopping_intent
2018-02-13 08:03:49.571370 WARNING AppDaemon: Unable to find app e in dependencies for shopping_intent
2018-02-13 08:03:49.571893 WARNING AppDaemon: Ignoring app shopping_intent
2018-02-13 08:03:49.572438 WARNING AppDaemon: Unable to find app s in dependencies for news_intent
2018-02-13 08:03:49.573101 WARNING AppDaemon: Ignoring app news_intent
2018-02-13 08:03:49.573647 WARNING AppDaemon: Unable to find app n in dependencies for news_intent
2018-02-13 08:03:49.574119 WARNING AppDaemon: Ignoring app news_intent
2018-02-13 08:03:49.574832 WARNING AppDaemon: Unable to find app i in dependencies for news_intent
2018-02-13 08:03:49.575473 WARNING AppDaemon: Ignoring app news_intent
2018-02-13 08:03:49.576144 WARNING AppDaemon: Unable to find app p in dependencies for news_intent
2018-02-13 08:03:49.576770 WARNING AppDaemon: Ignoring app news_intent
2018-02-13 08:03:49.577327 WARNING AppDaemon: Unable to find app s in dependencies for news_intent
2018-02-13 08:03:49.578019 WARNING AppDaemon: Ignoring app news_intent
2018-02-13 08:03:49.578579 WARNING AppDaemon: Unable to find app _ in dependencies for news_intent
2018-02-13 08:03:49.579254 WARNING AppDaemon: Ignoring app news_intent
2018-02-13 08:03:49.579854 WARNING AppDaemon: Unable to find app c in dependencies for news_intent
2018-02-13 08:03:49.580374 WARNING AppDaemon: Ignoring app news_intent
2018-02-13 08:03:49.581092 WARNING AppDaemon: Unable to find app o in dependencies for news_intent
2018-02-13 08:03:49.581619 WARNING AppDaemon: Ignoring app news_intent
2018-02-13 08:03:49.582293 WARNING AppDaemon: Unable to find app r in dependencies for news_intent
2018-02-13 08:03:49.582826 WARNING AppDaemon: Ignoring app news_intent
2018-02-13 08:03:49.583339 WARNING AppDaemon: Unable to find app e in dependencies for news_intent
2018-02-13 08:03:49.584014 WARNING AppDaemon: Ignoring app news_intent
2018-02-13 08:03:49.584571 WARNING AppDaemon: Unable to find app s in dependencies for home_automation
2018-02-13 08:03:49.585354 WARNING AppDaemon: Ignoring app home_automation
2018-02-13 08:03:49.585912 WARNING AppDaemon: Unable to find app n in dependencies for home_automation
2018-02-13 08:03:49.586439 WARNING AppDaemon: Ignoring app home_automation
2018-02-13 08:03:49.587136 WARNING AppDaemon: Unable to find app i in dependencies for home_automation
2018-02-13 08:03:49.587665 WARNING AppDaemon: Ignoring app home_automation
2018-02-13 08:03:49.588255 WARNING AppDaemon: Unable to find app p in dependencies for home_automation
2018-02-13 08:03:49.588874 WARNING AppDaemon: Ignoring app home_automation
2018-02-13 08:03:49.589414 WARNING AppDaemon: Unable to find app s in dependencies for home_automation
2018-02-13 08:03:49.590006 WARNING AppDaemon: Ignoring app home_automation
2018-02-13 08:03:49.590620 WARNING AppDaemon: Unable to find app _ in dependencies for home_automation
2018-02-13 08:03:49.591095 WARNING AppDaemon: Ignoring app home_automation
2018-02-13 08:03:49.591903 WARNING AppDaemon: Unable to find app c in dependencies for home_automation
2018-02-13 08:03:49.592537 WARNING AppDaemon: Ignoring app home_automation
2018-02-13 08:03:49.593253 WARNING AppDaemon: Unable to find app o in dependencies for home_automation
2018-02-13 08:03:49.593800 WARNING AppDaemon: Ignoring app home_automation
2018-02-13 08:03:49.594317 WARNING AppDaemon: Unable to find app r in dependencies for home_automation
2018-02-13 08:03:49.595059 WARNING AppDaemon: Ignoring app home_automation
2018-02-13 08:03:49.595617 WARNING AppDaemon: Unable to find app e in dependencies for home_automation
2018-02-13 08:03:49.596306 WARNING AppDaemon: Ignoring app home_automation
2018-02-13 08:03:49.596891 WARNING AppDaemon: Unable to find app s in dependencies for maths_intent
2018-02-13 08:03:49.597419 WARNING AppDaemon: Ignoring app maths_intent
2018-02-13 08:03:49.598100 WARNING AppDaemon: Unable to find app n in dependencies for maths_intent
2018-02-13 08:03:49.598636 WARNING AppDaemon: Ignoring app maths_intent
2018-02-13 08:03:49.599249 WARNING AppDaemon: Unable to find app i in dependencies for maths_intent
2018-02-13 08:03:49.599960 WARNING AppDaemon: Ignoring app maths_intent
2018-02-13 08:03:49.600511 WARNING AppDaemon: Unable to find app p in dependencies for maths_intent
2018-02-13 08:03:49.601188 WARNING AppDaemon: Ignoring app maths_intent
2018-02-13 08:03:49.601732 WARNING AppDaemon: Unable to find app s in dependencies for maths_intent
2018-02-13 08:03:49.602232 WARNING AppDaemon: Ignoring app maths_intent
2018-02-13 08:03:49.602940 WARNING AppDaemon: Unable to find app _ in dependencies for maths_intent
2018-02-13 08:03:49.603522 WARNING AppDaemon: Ignoring app maths_intent
2018-02-13 08:03:49.603982 WARNING AppDaemon: Unable to find app c in dependencies for maths_intent
2018-02-13 08:03:49.604695 WARNING AppDaemon: Ignoring app maths_intent
2018-02-13 08:03:49.605355 WARNING AppDaemon: Unable to find app o in dependencies for maths_intent
2018-02-13 08:03:49.605989 WARNING AppDaemon: Ignoring app maths_intent
2018-02-13 08:03:49.609255 WARNING AppDaemon: Unable to find app r in dependencies for maths_intent
2018-02-13 08:03:49.609812 WARNING AppDaemon: Ignoring app maths_intent
2018-02-13 08:03:49.610547 WARNING AppDaemon: Unable to find app e in dependencies for maths_intent
2018-02-13 08:03:49.611117 WARNING AppDaemon: Ignoring app maths_intent

So basically it is separating each line kind of

try the following. Not sure if it works or not

dependencies:
  - snips_core
1 Like

yup, as described are dependencies a list.

@turboc,

Oh ok, thought it was only necessary when it is more than a single dependency. Thanks and will do