Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance reload mechanism to support dependencies between files #18

Closed
insertjokehere opened this issue Dec 18, 2016 · 3 comments
Closed

Comments

@insertjokehere
Copy link

The automatic reload mechanism in appdaemon in cool, but doesn't support one of the most compelling use cases for appdaemon vs HAs built in automations: code reuse.

For example: I have a utils.py file that contains some utility functions that are used across several of my apps, like so:

-- utils.py --

class BaseApp(appapi.AppDaemon):
    def do_a_thing(self):
        self.foo()

-- lights.py --

from utils import BaseApp

class FunLights(BaseApp):

    def on_lights_on(self, kwargs):
        self.do_a_thing()

At the moment, if I change lights.py, everything is reloaded as expected (good) but if I change utils.py appdaemon doesn't recognize that it needs to reload lights.py as well (bad)

It would be really awesome if appdaemon would recognize (automatically? specially formed docstring?) that if utils.py changes, it also needs to reload lights.py

Thanks

@acockburn
Copy link
Member

This is an excellent idea - how about listing dependencies for an APP in the configuration file?

@snairolf
Copy link

snairolf commented Dec 18, 2016 via email

@acockburn
Copy link
Member

Added in next release.

Odianosen25 added a commit that referenced this issue Apr 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants