1
0
mirror of synced 2026-03-10 04:23:39 +00:00

Compare commits

8 Commits
1.0.5 ... 1.0.6

Author SHA1 Message Date
Daniel Chesterton
d7e52c0843 Add STORAGE_POLL_INTERVAL environment variable 2021-07-18 21:23:01 +01:00
Daniel Chesterton
dc6b6c0149 Merge pull request #21 from dchesterton/dependabot/github_actions/docker/login-action-1.10.0
[ci skip]: Bump docker/login-action from 1.9.0 to 1.10.0
2021-07-18 21:12:33 +01:00
Daniel Chesterton
2687358810 Merge pull request #25 from dchesterton/dependabot/github_actions/docker/build-push-action-2.6.1
[ci skip]: Bump docker/build-push-action from 2.5.0 to 2.6.1
2021-07-18 21:12:26 +01:00
Daniel Chesterton
1a076c7660 Merge pull request #27 from dchesterton/dependabot/github_actions/docker/setup-buildx-action-1.5.1
[ci skip]: Bump docker/setup-buildx-action from 1.3.0 to 1.5.1
2021-07-18 21:12:18 +01:00
dependabot[bot]
3ee2a7bf64 [ci skip]: Bump docker/setup-buildx-action from 1.3.0 to 1.5.1
Bumps [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) from 1.3.0 to 1.5.1.
- [Release notes](https://github.com/docker/setup-buildx-action/releases)
- [Commits](https://github.com/docker/setup-buildx-action/compare/v1.3.0...v1.5.1)

---
updated-dependencies:
- dependency-name: docker/setup-buildx-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-12 12:06:09 +00:00
dependabot[bot]
441905c91f [ci skip]: Bump docker/build-push-action from 2.5.0 to 2.6.1
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 2.5.0 to 2.6.1.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](https://github.com/docker/build-push-action/compare/v2.5.0...v2.6.1)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-02 12:06:12 +00:00
dependabot[bot]
a5a9383ad4 [ci skip]: Bump docker/login-action from 1.9.0 to 1.10.0
Bumps [docker/login-action](https://github.com/docker/login-action) from 1.9.0 to 1.10.0.
- [Release notes](https://github.com/docker/login-action/releases)
- [Commits](https://github.com/docker/login-action/compare/v1.9.0...v1.10.0)

---
updated-dependencies:
- dependency-name: docker/login-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-23 12:05:14 +00:00
bump_version
61cda99e5f Version 1.0.5 [skip ci] 2021-05-28 21:52:33 +00:00
4 changed files with 49 additions and 44 deletions

View File

@@ -27,15 +27,17 @@ jobs:
ref: main
- name: Set up QEMU
uses: docker/setup-qemu-action@v1.2.0
with:
platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64/v8,linux/ppc64le,linux/s390x
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1.3.0
uses: docker/setup-buildx-action@v1.5.1
- name: Login to DockerHub
uses: docker/login-action@v1.9.0
uses: docker/login-action@v1.10.0
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push
uses: docker/build-push-action@v2.5.0
uses: docker/build-push-action@v2.6.1
with:
context: .
push: true

View File

@@ -16,6 +16,7 @@ It supports the following environment variables:
- `MQTT_PORT` (optional, default = 1883)
- `HOME_ASSISTANT` (optional, default = false)
- `HOME_ASSISTANT_PREFIX` (optional, default = 'homeassistant')
- `STORAGE_POLL_INTERVAL` (optional, default = 3600) - how often to fetch storage data (in seconds)
It exposes events to the following topics:

View File

@@ -1 +1 @@
1.0.4
1.0.5

View File

@@ -8,7 +8,6 @@ from json import dumps
import signal
from threading import Timer
storage_sensors_interval = 60 # 1 hour
is_exiting = False
mqtt_client = None
@@ -17,6 +16,7 @@ amcrest_host = os.getenv("AMCREST_HOST")
amcrest_port = int(os.getenv("AMCREST_PORT") or 80)
amcrest_username = os.getenv("AMCREST_USERNAME") or "admin"
amcrest_password = os.getenv("AMCREST_PASSWORD")
storage_poll_interval = int(os.getenv("STORAGE_POLL_INTERVAL") or 3600)
mqtt_host = os.getenv("MQTT_HOST") or "localhost"
mqtt_qos = int(os.getenv("MQTT_QOS") or 0)
@@ -78,9 +78,9 @@ def exit_gracefully(rc, skip_mqtt=False):
os._exit(rc)
def refresh_storage_sensors():
global camera, topics, storage_sensors_interval
global camera, topics, storage_poll_interval
Timer(storage_sensors_interval, refresh_storage_sensors).start()
Timer(storage_poll_interval, refresh_storage_sensors).start()
log("Fetching storage sensors...")
try:
@@ -239,6 +239,7 @@ if home_assistant:
json=True,
)
if storage_poll_interval > 0:
mqtt_publish(
topics["home_assistant"]["storage_used_percent"],
base_config
@@ -288,6 +289,7 @@ mqtt_publish(topics["config"], {
"serial_number": serial_number,
}, json=True)
if storage_poll_interval > 0:
refresh_storage_sensors()
log("Listening for events...")