batpred
batpred copied to clipboard
WIP: Add preparation for potentially running the same code within AppDaemon or HA integration
DRAFT, not to be merged for now
This is doing some preparatory work for a potential approach to supporting running Predbat within a HA integration in the future.
Essentially, it's aiming to allow Predbat to run either within AppDaemon, or as its own HA integration, by:
- Providing alternate imports for the AppDaemon classes that the Predbat class is based on
- Adding a feature flag which allows code that needs to vary between the two modes (AppDaemon or HA integration) to make decisions about how to handle that
These approaches should allow the identical code to run in either environment (once the supporting code for a HA integration is wrapped around it).
The work to wrap this code is currently being done elsewhere.