Compare commits
11 Commits
v1.7.2
...
add-networ
| Author | SHA1 | Date | |
|---|---|---|---|
| 26b955a1e8 | |||
| bb17ad6135 | |||
| 40c7d020d2 | |||
| 9b5adba3ed | |||
|
|
73740ffa39 | ||
|
|
e513752c46 | ||
|
|
cfb392dc6a | ||
| f3f78c4ad5 | |||
| d1723db798 | |||
| ba8486017a | |||
| 37d8b17076 |
@@ -35,6 +35,8 @@ build:
|
||||
--pull
|
||||
--cache-from $CI_REGISTRY_IMAGE:latest
|
||||
--tag $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
|
||||
--build-arg BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')
|
||||
--build-arg VCS_REF=$CI_COMMIT_SHORT_SHA
|
||||
./Docker/
|
||||
- docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
|
||||
|
||||
@@ -91,3 +93,20 @@ sast:
|
||||
stage: test
|
||||
include:
|
||||
- template: Security/SAST.gitlab-ci.yml
|
||||
|
||||
sonarqube-check:
|
||||
image:
|
||||
name: sonarsource/sonar-scanner-cli:latest
|
||||
entrypoint: [""]
|
||||
variables:
|
||||
SONAR_USER_HOME: "${CI_PROJECT_DIR}/.sonar" # Defines the location of the analysis task cache
|
||||
GIT_DEPTH: "0" # Tells git to fetch all the branches of the project, required by the analysis task
|
||||
cache:
|
||||
key: "${CI_JOB_NAME}"
|
||||
paths:
|
||||
- .sonar/cache
|
||||
script:
|
||||
- sonar-scanner
|
||||
allow_failure: true
|
||||
only:
|
||||
- master # or the name of your main branch
|
||||
|
||||
@@ -1,3 +1,10 @@
|
||||
## [1.7.3](https://gitlab.evanrichardsonphotography.com/erichardson/py-eagle-mqtt/compare/v1.7.2...v1.7.3) (2021-04-12)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Empty commit to get recent changes into build (last commit should've been labeled this) ([e513752](https://gitlab.evanrichardsonphotography.com/erichardson/py-eagle-mqtt/commit/e513752c46cc0b3beb93530f6549661d67196905))
|
||||
|
||||
## [1.7.2](https://gitlab.evanrichardsonphotography.com/erichardson/py-eagle-mqtt/compare/v1.7.1...v1.7.2) (2021-04-08)
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,17 @@
|
||||
FROM python:3.9.4-alpine3.13
|
||||
|
||||
LABEL maintainer="Evan Richardson (evanrich81[at]gmail.com)"
|
||||
LABEL version="1.7.0"
|
||||
|
||||
ARG BUILD_DATE
|
||||
ARG VCS_REF
|
||||
|
||||
LABEL org.label-schema.schema-version="1.0"
|
||||
LABEL org.label-schema.build-date=$BUILD_DATE
|
||||
LABEL org.label-schema.name="evanrich/py-eagle-mqtt"
|
||||
LABEL org.label-schema.description="Python Rainforest Eagle to MQTT Application"
|
||||
LABEL org.label-schema.vcs-url="https://github.com/evanrich/py-eagle-mqtt"
|
||||
LABEL org.label-schema.vcs-ref=$VCS_REF
|
||||
LABEL org.label-schema.vendor="Evan Richardson"
|
||||
LABEL org.label-schema.docker.cmd="docker run --name=py-eagle-mqtt -e MQTT_BROKER_IP=<IP> -e MQTT_BROKER_PORT=1883 -p 22042:22042 -d evanrich/py-eagle-mqtt"
|
||||
|
||||
WORKDIR /app
|
||||
COPY requirements.txt /app
|
||||
|
||||
@@ -22,6 +22,7 @@ import json
|
||||
import bottle as B
|
||||
import tHome as T
|
||||
|
||||
|
||||
# ===========================================================================
|
||||
def meter(client, data, cfg):
|
||||
msg = {
|
||||
@@ -30,7 +31,8 @@ def meter( client, data, cfg ):
|
||||
"produced": data.Produced, # kWh
|
||||
}
|
||||
|
||||
return ( cfg.mqttEnergy, msg )
|
||||
return cfg.mqttEnergy, msg
|
||||
|
||||
|
||||
# ===========================================================================
|
||||
def instant(client, data, cfg):
|
||||
@@ -39,7 +41,8 @@ def instant( client, data, cfg ):
|
||||
"power": data.Power * 1000, # W
|
||||
}
|
||||
|
||||
return ( cfg.mqttPower, msg )
|
||||
return cfg.mqttPower, msg
|
||||
|
||||
|
||||
# ===========================================================================
|
||||
def price(client, data, cfg):
|
||||
@@ -48,7 +51,18 @@ def price( client, data, cfg ):
|
||||
"price": data.Price,
|
||||
"tier": data.Tier,
|
||||
}
|
||||
return ( cfg.mqttPrice, msg )
|
||||
return cfg.mqttPrice, msg
|
||||
|
||||
|
||||
# ===========================================================================
|
||||
def network(client, data, cfg):
|
||||
msg = {
|
||||
"status": data.Status,
|
||||
"description": data.Description,
|
||||
"linkstrength": data.LinkStrength
|
||||
}
|
||||
return cfg.mqttNetwork, msg
|
||||
|
||||
|
||||
# ===========================================================================
|
||||
handlers = {
|
||||
@@ -59,13 +73,14 @@ handlers = {
|
||||
"InstantaneousDemand": instant,
|
||||
# "MessageCluster" :
|
||||
# "MeterInfo" :
|
||||
#"NetworkInfo" :
|
||||
"NetworkInfo": network,
|
||||
"PriceCluster": price,
|
||||
# "Reading" :
|
||||
# "ScheduleInfo" :
|
||||
# "TimeCluster" :
|
||||
}
|
||||
|
||||
|
||||
# ===========================================================================
|
||||
|
||||
@B.post('/')
|
||||
@@ -90,6 +105,7 @@ def root_post():
|
||||
|
||||
return "ok"
|
||||
|
||||
|
||||
# ===========================================================================
|
||||
#
|
||||
# Main applications script
|
||||
|
||||
@@ -23,6 +23,9 @@ mqttPrice = 'power/elec/Home/price'
|
||||
#Current rate label (returns rate label from meter)
|
||||
mqttRateLabel = 'power/elec/Home/ratelabel'
|
||||
|
||||
#Network Info Topic (returns status, description and link strength from meter)
|
||||
mqttNetwork = 'power/elec/Home/network'
|
||||
|
||||
#===========================================================================
|
||||
#
|
||||
# Logging configuration. Env variables are allowed in the file name.
|
||||
|
||||
@@ -1,8 +1,17 @@
|
||||
# py-eagle-mqtt
|
||||
|
||||
Python3 based Docker for Eagle to MQTT reader
|
||||
|
||||
I have only ported this into a dockerfile, as well as made some changes to code for security or other purposes. All Original code is credit to [Ted Drain - TD22057](https://github.com/TD22057/T-Home).
|
||||
|
||||
This project utilizes the following tools:
|
||||
|
||||
[](https://github.com/semantic-release/semantic-release)
|
||||
[]()
|
||||
[]()
|
||||
[]()
|
||||
[]()
|
||||
|
||||
## UPDATES:
|
||||
|
||||
2020-04-06: Moved Updates to a CHANGELOG.md file to clean this up.
|
||||
|
||||
3
sonar-project.properties
Normal file
3
sonar-project.properties
Normal file
@@ -0,0 +1,3 @@
|
||||
sonar.projectKey=erichardson_py-eagle-mqtt_AXkgI9tRLcemhRz3NCjo
|
||||
sonar.qualitygate.wait=true
|
||||
sonar.projectBaseDir=Docker/src
|
||||
Reference in New Issue
Block a user