Commit graph

42 commits

Author SHA1 Message Date
Clayton Nummer
abc151601b Adjust lights immediately when disable entity state changes
I'm thinking about removing the disable entity option, but while it remains this is the proper behavior
2019-08-04 14:49:14 -04:00
Clayton Nummer
be01be243d Define "initial transition" and use it when CL switch is turned on
A 1 sec transition was used when a light is turned on or when sleep state changes. The short transition should also be used when the CL switch is turned on. Also, because this is used in multiple spots, better to define it in one spot (this will also make it easier to make it configurable, if desired)
2019-08-04 14:16:59 -04:00
Clayton Nummer
7185fe3feb Only react to light state change to 'on' 1.0.8b
And only when light isn't already on. This should allow for users to disable CL when they adjust a light from the frontend, without CL immediately readjusting. This also should remove the need for checking state of each light before adjusting, because infinite loops should no longer trigger.
2019-07-31 14:53:34 -04:00
Clayton Nummer
6dcd192f4e Bump version number 1.0.7b 2019-07-30 18:25:42 -04:00
Clayton Nummer
14f272e8cd Change brightness scale to max at 254
Supposedly the max light brightness is 255, but my Hue and Lightify lights both max at 254. 0 turns off the light, so the range is probably (0, 255) not [0, 255]
2019-07-30 18:25:02 -04:00
Clayton Nummer
40568296ed Slight efficiency tweaks
Don't calculate values for every light, and only set service_data if it's going to be used
2019-07-30 17:48:33 -04:00
Clayton Nummer
36115d4fce Check light values before setting them
Hopefully this eliminates possible "infinite loop" of adjustment, where the SERVICE_TURN_ON call triggers  CL to adjust and so on.
2019-07-30 17:13:47 -04:00
Clayton Nummer
50ae5208ca Attempt to fix info.md for HACS 2019-06-29 21:19:05 -04:00
Clayton Nummer
7c7b5ec072 Repo is now included in default repositories
Update HACS badge
2019-06-29 21:18:50 -04:00
Clayton Nummer
fbafcebe66 Add instructions and info for HACS 2019-06-27 14:35:07 -04:00
Clayton Nummer
f3a1a73885 Remove configuration options from entity attributes
The biggest concern is that apparently any device_class with longitude, latitude, and elevation will show up on the HA map (not just device_tracker). In general, however, configuration options in attributes is extraneous and the community voted to remove them (https://community.home-assistant.io/t/circadian-lighting-custom-component/61246/355)
2019-06-14 16:27:28 -04:00
Clayton Nummer
6d9df861ce Tweak default interval/transition for better compatibility
Some types of lights seem to have issues with long transitions
2019-06-08 11:20:58 -04:00
Clayton Nummer
4f332a514c Re-write of values calculation
The basis of Circadian Lighting is to figure out how to adjust lights to mimic the sun, which is roughly parabolic above and below the horizon. Originally I used three points to calculate the parabolas - sunrise, sunset, and solar noon/midnight. I did a bunch of generic arithmetic to generate the parabola from those three points. The problem is that this arithmetic generates a parabola from _any_ three points - in reality the points I have are the intercepts and vertex.

The problem with the old method is that if solar noon/midnight did not fall exactly between sunrise and sunset then the calculated vertex could be more or less than 100%, which would cause the integration to set color/brightness values above or below the set min/max. Generating a parabola from the intercepts and vertex is much simpler and also should guarantee the min/max are what's expected. 

In addition to this change, I'm also now calculating 4 "half" parabolas instead of just one for above horizon and one for below horizon. The "half" parabolas are: sunrise->solar-noon, solar-noon->sunset, sunset->solar-midnight, solar-midnight->sunrise. This is necessary for the case where solar noon/midnight don't fall exactly half way between sunrise and sunset, which is especially prevalent for users who specify a specific time for sunrise or sunset but not both.

I'm embarrassed at how it's been before it dawned on me that I could calculate the parabolas from intercepts/vertex rather than the three random points method, but hopefully this fixes inconsistencies for users - it should definitely fix issue #25!
2019-06-01 14:20:47 -04:00
Clayton Nummer
34d5529a05 Increment version
for added manifest.json and services.yaml
2019-05-09 13:25:48 -04:00
Clayton Nummer
bb4e7f82a3
Merge pull request #21 from claytonjn/master
Pull in manifest.json and services.yaml
2019-05-09 13:18:52 -04:00
Clayton Nummer
59ee744787
Merge pull request #19 from boralyl/feature/add-manifest
Adds manifest.json
2019-05-09 13:15:27 -04:00
Clayton Nummer
85abb4bb5b
Small tweak 2019-05-09 13:14:15 -04:00
Clayton Nummer
1f679de674
Small tweak 2019-05-09 13:13:47 -04:00
Aaron Godfrey
b3252e52a8 Added missing services.yaml 2019-05-06 07:33:23 -07:00
Aaron Godfrey
6b0a4f942b Added manifest.json 2019-05-04 09:54:32 -07:00
Clayton Nummer
739fda7a86
Merge pull request #16 from claytonjn/dev
Update README.md
2019-04-13 10:06:13 -04:00
Clayton Nummer
f1d05b2bf5
Update README.md
Add new (to me) Circadian Rhythm article.
2019-04-13 10:02:36 -04:00
Clayton Nummer
0246260b69
Merge pull request #14 from claytonjn/dev
Update README.md
2019-04-11 12:21:28 -04:00
Clayton Nummer
60a40bac48
Update README.md 2019-04-11 12:20:55 -04:00
Clayton Nummer
1f61bf990d Merge remote-tracking branch 'origin/master' 1.0.3 2019-04-05 15:36:13 -04:00
Clayton Nummer
8e2570f50b Merge branch 'dev' 2019-04-05 15:36:01 -04:00
Clayton Nummer
e66bea0695 Increment version 2019-04-05 15:35:45 -04:00
Clayton Nummer
6c37e03222 conf.get seems to handle missing hass.config variables - remove or None
Should fix #8
2019-04-05 13:03:49 -04:00
Clayton Nummer
fb7912242c Merge branch 'dev' 1.0.2 2019-04-04 22:57:31 -04:00
Clayton Nummer
d70e7d0c91 Remove time_zone configuration variable
astral seems to only be compatible with with deprecated time zone strings, and because times returned are timezone aware the calculations still work properly.
2019-04-04 22:57:17 -04:00
Clayton Nummer
320ccb3dae Merge branch 'dev' 2019-04-04 22:21:33 -04:00
Clayton Nummer
8a68ddbea5 Merge branch 'master' into dev 2019-04-04 22:21:01 -04:00
Clayton Nummer
16377d26e9 Remove const.py from custom_updater.json resources 2019-04-04 22:20:54 -04:00
Clayton Nummer
1b8577d5db Merge branch 'dev' 1.0.1 2019-04-04 22:03:10 -04:00
Clayton Nummer
2d135ca119 Improve getting astral times
Include time_zone and elevation to get more accurate times. Always pass date into get_sunrise_sunset (otherwise it was returning inconsistent results). Add some debug logging.
2019-04-04 22:01:15 -04:00
Unknown
7033695a34 Get rid of const.py 1.0.0
so there are fewer files for users to install
2019-04-04 21:29:51 -04:00
Clayton Nummer
4ce6bb9f4a
Update README.md 2019-04-04 21:16:06 -04:00
Clayton Nummer
daff266290
Update README.md 2019-04-04 21:11:32 -04:00
Clayton Nummer
44eee25b84
Update README.md 2019-04-04 21:09:25 -04:00
Clayton Nummer
de1180be7a Include updated_atfor custom_updater
hopefully custom_updater starts working
2019-04-03 16:30:57 -04:00
Clayton Nummer
e80f45b90b Initial push
with new folder structure and custom_updater support (hopefully)
2019-04-03 15:35:39 -04:00
Clayton Nummer
7e29b7c640
Initial commit 2019-04-03 14:29:22 -04:00