[Add] Ping and Weather custom sensor + ColoredFlat Theme #510
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello,
I've added two sensors :
and one theme :
Ping Sensor
The ping sensor is used to know the latency of our network connection, and is based on the simple ping livrary from python (added to requirements.txt).
It is using the "custom sensor" not-so-new architecture to allow the tracking of ping.
pros: easy to do and maintain
cons: the ping module cannot (for the moment) have it's own interval, making it strange/difficult to use if there are multiple custom sensor that need different interval.
Weather Sensor
Added a weather sensor, first using also the custom sensor module, but due to the interval of custom sensor, I had to change the way to do it and create a "real sensor".
Modifications are based on the fork https://github.com/GaryStar/turing-smart-screen-python/tree/feature/names-alert-weather from @GaryStar with modifications.
The weather sensor has it's own setup in config.yaml, and need an api key from OneCall 3.0 api openweathermap.org. It's free for the first daily 1000 api calls, so it's enough for a daily use even if the program is running 24/7 if the interval is setuped >90s (note the API refresh rate seems to be more like 10 to 20 minutes, so it's perfect.
New Theme : Colored Flat
I don't know if it's the right way to do it, or even if it will be interesting for other, but I added my personnal theme called Colored Flat, that features the new weather component, and Ping component with line_graphs ping history