Open Lakitna opened 7 years ago
Commit a4ed1e11f3e0370341f2c630c41993633d70c800:
Changed deviationData
from linear to exponential decay using function y = -0.0001x^3+100 for 0 <= x <= 99
Changed deviationDuration
in settings/Template.py
to 45 minutes
Removed automaticStateChange
from settings/Template.py
and cycle.py
Added automaticPowerOff
to settings/Template.py
and cycle.py
Added automaticPowerOn
to settings/Template.py
and cycle.py
Added validation for new settings
Added automatic program restart on time defined in Global settings. I noticed that sometimes I needed to restart the program because of network changes/issues. For example a few days ago the local IP of the Gateway suddenly changed and the program was stuck in an infinite loop of timeouts. By daily restarting the program I hope to solve this.
Later I moved this from the API into the platform-specific wrapper.
I also added logging to this branch, because the automatic restart allowed me to easily split the log files into daily files. Adding logging also removed some print functions from helper.py
so I bumped to v0.2.0
Adding the logging now also allows me to see if the program actually restarts at the correct time and the logging summary allows me to see the performance of the program a lot better.
Commit fc344f52fbfea07587a869477d8425199e9945c5:
Restructured settings/Global.py
and settings/Template.py
Make use of userWindDownTime
to alert the user via the lamps that it is almost time for bed. This only works for cycles with more than one lamp.
By turning off about half (all uneven) lamps the user should see that it's almost time for bed.
In this branch, I also made it so that every lamp has its own observer instead of every cycle. this makes things a lot more stable.
Overhaul logger to output more meaningful data and/or in a more meaningful way.
This completes the following:
Changes behaviour of deviation by only applying it during the evening.
Introduces dynamic settings. These settings can be changed during runtime using the normal controls. They aim to be invisible in their use and work on every lamp separately.
Introduces cycle anatomy to the lookup class. This allows the program to easily see if a timecode is during the users morning
, day
, evening
, or night
.
Makes duration of deviation cycle dynamic. Deviation now always lasts until the lamps go off. If Deviation is triggered shortly before a lamp goes off this lamp will simply go off later.
Introduces support for unorthodox sleep cycles by supporting 0-hour rollover on all 4 stages.
Dynamic settings now also store what the lamp is capable of in three booleans: dim
, temp
, and color
. These are used to prevent updates the lamp can't handle.
This PR also adds support for color bulbs.
Introduces the scheduler. This is used to schedule things like log file cleanup.
Closes the following things:
To do for major version 1
automaticStateChange
settings/Template.py
settings/Global.py
userWindDownTime
to alert the user via the lamps that it is almost time for bed.Deviation
class to be more useful in real-life situationsdeviationData
instead of lineardeviationDuration
brightnessData['eveningSlope']
instead of linearAnd finally do: