-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve error handling, Nightly build #44
Conversation
src/logging.rs
Outdated
@@ -4,7 +4,13 @@ use chrono::Local; | |||
use env_logger::Builder; | |||
use log::LevelFilter; | |||
|
|||
pub fn init_logger() { | |||
pub fn init_logger(debug: bool) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's possible to do this from an environment variable without a code change:
RUST_LOG=debug
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR looks great! I think we could get it in without too many changes other than removing the Rust code changes and using the environment variable to trigger verbose logging.
Nice! I guess the build/push to docker hub will 'just work'™️ once the PR is merged, or does it require additional changes in configuration? |
For the nightly build you still need to define the Still need to
|
Ah, right. I'll put that secret in tomorrow. |
thx for the collaboration invite :-) everything seems to be working in the addon so far, but I'll test again tomorrow when the sun is up |
Did you try with the latest changes from yesterday? It will try to deliver three times before it gives up. Also, requesting data more often than every 30.5 seconds will prohibit the inverter from updating. Then the data stays the same. |
Added DOCKER_HUB_REPOSITORY_NIGHTLY to point to https://hub.docker.com/repository/docker/dennisosrm/hms-mqtt-publisher-nightly/general |
Haven't been able to spend any time on this, I'll probably do some more testing tomorrow |
Sounds good. Thanks for the heads up. |
Looks good now! I've updated the nightly addon as well as the main one (after testing the nightly version) to the latest build from main. I've also fixed the workflow files, the builds were failing because it couldn't access the GIT_HASH. I think the nightly workflow is still failing because it can't access the secrets before it's merged. I think the PR should be ready to be merged now. |
Cool. Then let's get it in! |
|
||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). | ||
|
||
## [v0.4] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We haven't released 0.3 yet. 😀 I can fix the version number as part of the the next release. No need to rush.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I need to do a version bump in the addon, otherwise home assistant won't show that an update exists, so I've been setting the addon versions independently of the releases
Thanks so much for the great work. |
Just realized that the nightly build is also run on PRs. I am not sure we'd want that. What do you think? |
I think it's actually quite useful to see if a PR builds successfully and it also allows to quickly reference a build in docker hub for local testing in the home assistant addon. Btw the branch name is added to the tag, so there's no conflict with the main builds |
perfect. then that's more than fine. 😀 |
cargo clippy
and fix all issuescargo fmt
to format all source filesThis PR includes the following updates:
--debug_logging
parameter and corresponding option in Home Assistanttry_publish
instead ofpublish
to propagate MQTT connection errorsIt should've probably been separate PRs, but I haven't had the time yet to separate the work into multiple branches. I can do that over the next couple of days if necessary, but wanted to open the PR already to get some feedback.