philhzss / calendartrigger Goto Github PK
View Code? Open in Web Editor NEWStandalone version of my calendar.cpp from TCS, which I use for controlling my garage light
License: GNU General Public License v3.0
Standalone version of my calendar.cpp from TCS, which I use for controlling my garage light
License: GNU General Public License v3.0
Right now it's compiled and can't be changed unless you recompile
Would be nice to able to see when the next event is. For now, we only find out there is an event when we test for it right now, so we would have to make a new function loop to check up to X hours into the future, then just update a variable containing the future event for the API
Not sure why, but must add some kind of timeout to avoid looping forever there
CPU goes to 100% as it just loops forever until the mutex unlocks
Could be useful for other Home Assistant things I'm trying to do. If I can figure out the next next event, then I can figure out how many hours off I have between next two shifts. Perhaps just make an array that shows the next 5 events or something. Would be a mix of start and ends though.. unless I make the array just show starts, and only the "nextFutureEvent" can actually show starts and ends?
By running eventTimeCheck in initAll (ref e0d1733), yes we get the desired effect of no longer having an empty "future event" value between initAll & trigger loop, BUT, since it runs it, if there is an action (turn on light for example), when it actually runs it in the trigger loop, it will report duplicate, since it already reported lightOn in initAll... the action will never occur
We cannot run eventTimeCheck like that in initAll. Must add a flag to make sure it "doesn't count" for an action, or must somehow update future events without event time check
Once the event is triggered, we don't need to keep checking anything
Add a user-agent header for philhzss/pgp-pythonAPI#19
I'm using "lock" in main, instead of try-lock. If main runs during the exact moment a Crow request is going on, it'll fail.
Must be per person. Having a global "light should be on" and preventing light turn offs during that time will make it so that home assistant will never turn off the light if someone leaves during the regular light on period
API should report "light should be on" for each person and Home Assistant can shut down light only if that specific person has left home
For a short moment (< 0.5s), between the cleanup from the last run and the init/reading of the settings file, the API does not know the people in the database so it just reports app settings. This is bad.
Maybe I could copy the last settings vector and overwrite it each run (updating it), instead of sending the one that gets wiped to the API?
The program doesn't check to see if currently 2 different calendars are trying to keep the lights on, so if one of them triggers startOff for example, it will turn the lights off even if another person is expecting them to stay on
Text files way too large
2021-01-17 13:49:26 [Calendar Debug] Triggered by a timer value of (timer-minsBefore): 30
The confirmation that the command work is not really our job? Instead we are storing if it was suppose to be sent, then move on. See issue #9
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.