Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: matijse/eufy-ha-mqtt-bridge
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 0.1.0
Choose a base ref
...
head repository: matijse/eufy-ha-mqtt-bridge
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
Loading
Showing with 964 additions and 1,429 deletions.
  1. +10 −2 .github/workflows/docker-build.yml
  2. +18 −0 .github/workflows/docker-try-build.yml
  3. +2 −2 Dockerfile
  4. +8 −3 config/index.js
  5. +4 −1 data/config.example.yml
  6. +0 −91 db/index.js
  7. +226 −9 enums/device_type.js
  8. +34 −15 enums/notification_type.js
  9. +7 −0 enums/sensor_type.js
  10. +49 −8 eufy/client.js
  11. +55 −0 eufy/devices.js
  12. +64 −12 eufy/http.js
  13. +1 −1 eufy/index.js
  14. +13 −9 eufy/push.js
  15. +2 −2 index.js
  16. +122 −165 mqtt/client.js
  17. +161 −159 mqtt/ha-discovery.js
  18. +91 −878 package-lock.json
  19. +1 −2 package.json
  20. +83 −70 readme.md
  21. +13 −0 sheduler/index.js
12 changes: 10 additions & 2 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
@@ -22,5 +22,13 @@ jobs:
with:
push: true
platforms: linux/amd64,linux/arm/v7,linux/arm64/v8
tags: matijse/eufy-ha-mqtt-bridge:latest
tag_with_ref: true
tags: |
matijse/eufy-ha-mqtt-bridge:${{ github.event.release.tag_name }}
matijse/eufy-ha-mqtt-bridge:latest
- name: Trigger Addon update
uses: peter-evans/repository-dispatch@v1
with:
token: ${{ secrets.REPO_ACCESS_TOKEN }}
repository: MaxWinterstein/homeassistant-addons
event-type: create_mr_and_build_image
client-payload: '{"version": "${{ github.event.release.tag_name }}"}'
18 changes: 18 additions & 0 deletions .github/workflows/docker-try-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Build Docker image
on:
workflow_dispatch:
jobs:
build_images:
name: Test if images can be build
runs-on: ubuntu-latest
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Build
id: docker_build
uses: docker/build-push-action@v2
with:
push: false
platforms: linux/amd64,linux/arm/v7,linux/arm64/v8
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
FROM node:14
FROM node:14-alpine

WORKDIR /app

COPY package*.json ./

RUN npm install

COPY . .
COPY . ./

CMD ["npm", "run", "start"]
11 changes: 8 additions & 3 deletions config/index.js
Original file line number Diff line number Diff line change
@@ -6,9 +6,13 @@ const winston = require('winston')
class Config {
eufyUsername
eufyPassword

mqttUrl
mqttUsername
mqttPassword
mqttKeepalive

haOffDelay

constructor () {
let config
@@ -25,13 +29,14 @@ class Config {
this.mqttUrl = get(config, 'mqtt.url')
this.mqttUsername = get(config, 'mqtt.username')
this.mqttPassword = get(config, 'mqtt.password')
this.mqttKeepalive = parseInt(get(config, 'mqtt.keepalive', { default: 60 }))

this.haOffDelay = parseInt(get(config, 'home_assistant.off_delay', { default: 5 }))

if (
typeof this.eufyUsername === "undefined" ||
typeof this.eufyPassword === "undefined" ||
typeof this.mqttUrl === "undefined" ||
typeof this.mqttUsername === "undefined" ||
typeof this.mqttPassword === "undefined"
typeof this.mqttUrl === "undefined"
) {
winston.error('Missing configuration, please check config.yml')
throw new Error('Missing configuration, please check config.yml')
5 changes: 4 additions & 1 deletion data/config.example.yml
Original file line number Diff line number Diff line change
@@ -4,4 +4,7 @@ eufy:
mqtt:
url: "mqtt://dockerhost:1883"
username: "user"
password: "password"
password: "password"
keepalive: 60
home_assistant:
off_delay: 5
91 changes: 0 additions & 91 deletions db/index.js

This file was deleted.

Loading