Skip to content

Conversation

@KeithB
Copy link

@KeithB KeithB commented Jun 2, 2024

2 general themes for this PR:

  • Improve standalone container setup and add compose.
  • Consolidate standalone and HA build and run as much as possible to reduce add-on/container maintenance from future predbat changes.

Assumptions:

  • Majority of future work will be predbat.py and/or hass.py. On this basis, these changes reduce overhead for future changes.
  • Supervisor token is always and only visible to top level run.sh when running as add-on.

Following changes made in this PR:

  • Standalone container moved to Python3 Debian Slim - saves > 300MB container size. Also updated to build from the same requirements.txt as addon. Minor tweak to requirements.txt.
  • startup.py tweaked (and renamed) to a general bootstrap - start is outside this now. Download based on predbat.py rather than apps.yaml. Will also only download apps.yaml if not found to avoid overwriting existing configs.
  • Single run.sh for container and add-on config. Different behaviour for restarts - auto restart if add-on but falls back to container properties (e.g. compose) when running as standalone container. (ASSUMPTION: supervisor token is always and only visible when running as add-on)
  • Added docker compose to allow simple setup of standalone docker container.
  • Documentation update

Other:

  • WARNING: Standalone container setup has been running stably for several days. Add-on install no HAOS not tested (no environment available) but code lines up. Recommend testing before accepting PR to release.

sammort added a commit to sammort/predbat_addon that referenced this pull request Jun 16, 2024
@springfall2008
Copy link
Owner

Sorry I haven't merged this, I don't understand the implications of the change but it appears like it might overwrite the local version of predbat when started which I'm not so sure about.

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

Successfully merging this pull request may close these issues.

2 participants