Commit graph

54 commits

Author SHA1 Message Date
Bas Nijholt
31da53182f fix doc-string 2020-09-10 11:58:32 +02:00
Bas Nijholt
4234be19ec fix import 2020-09-10 11:58:32 +02:00
Bas Nijholt
90cbd2980e profiles -> profile 2020-09-10 11:58:32 +02:00
Bas Nijholt
fd1f2fdb66 add option to add multiple profiles 2020-09-10 11:58:32 +02:00
Bas Nijholt
f6219de84f another attempt 2020-09-10 11:58:32 +02:00
Bas Nijholt
eb8da2e46b initial implementation of profiles 2020-09-10 11:58:32 +02:00
Bas Nijholt
65b1aa4b84 start implementing profile settings, as suggested in https://github.com/claytonjn/hass-circadian_lighting/issues/91#issuecomment-647084406 2020-09-10 11:58:31 +02:00
Bas Nijholt
3bf3c5f541 fix the today['sunset'] is not set before used in comparison 2020-09-09 23:26:30 +02:00
Bas Nijholt
55673b7e61 remove timezonefinder dependency 2020-09-06 09:59:20 +02:00
Bas Nijholt
becc846287 component -> platform 2020-09-01 20:02:23 +02:00
Bas Nijholt
25cbcf635b remove ._manual_time dict 2020-09-01 18:16:11 +02:00
Bas Nijholt
ce19976c5e fixes from previous commit 2020-09-01 17:28:38 +02:00
Bas Nijholt
9e03d5aeeb remove arg in get_sunrise_sunset and call update in __init__ 2020-09-01 16:44:24 +02:00
Bas Nijholt
4c9d1f6659 use async functions and call trackers/listeners in the correct place 2020-09-01 16:40:29 +02:00
Bas Nijholt
9dc04bc7c1 remove code that wasn't needed 2020-09-01 00:11:36 +02:00
Bas Nijholt
3475bd9b90 date is never None and renames 2020-08-31 23:41:36 +02:00
Bas Nijholt
13bbdd4ad4 create _replace_time method 2020-08-31 23:24:19 +02:00
Bas Nijholt
063a2386af add @log decorator 2020-08-31 22:50:33 +02:00
Bas Nijholt
e257af03bf call self._update_switch in light_state_changed 2020-08-31 17:47:41 +02:00
Bas Nijholt
e058091f52 allow CONF_SLEEP_STATE and CONF_DISABLE_STATE to be lists and add defaults 2020-08-31 17:47:41 +02:00
Bas Nijholt
1f8324c065 more simplifications 2020-08-31 17:47:35 +02:00
Bas Nijholt
d9deee9e52 simplify calc_percent 2020-08-31 12:00:21 +02:00
Bas Nijholt
875542650e more simplifications and renames 2020-08-31 00:39:41 +02:00
Bas Nijholt
5ff9be0090 create ._time dict 2020-08-31 00:27:52 +02:00
Bas Nijholt
d4551746c6 do not define a .data dict 2020-08-31 00:20:25 +02:00
Bas Nijholt
dfa0f8cc60 renames 2020-08-31 00:15:32 +02:00
Bas Nijholt
be0e58c3f0 move comments 2020-08-25 19:14:02 +02:00
Bas Nijholt
c75b1238d8 simplify track_time_change setup 2020-08-25 19:12:37 +02:00
Bas Nijholt
b3e4834421 simplify time.replace calls 2020-08-25 19:06:00 +02:00
Bas Nijholt
0780879a0b simplify setup() 2020-08-25 19:02:18 +02:00
Bas Nijholt
d2dda06802 remove unused import 2020-08-25 18:52:48 +02:00
Bas Nijholt
c0082175b6 simplify debug logging call 2020-08-25 18:52:23 +02:00
Bas Nijholt
9b8a4ad51f run black, pyupgrade, and isort 2020-08-25 18:08:33 +02:00
Clayton Nummer
ff4854e7b7 Version bump for master 2020-06-11 13:09:31 -04:00
Clayton Nummer
976a35e109
Merge branch 'dev' into master 2020-06-03 21:05:42 -04:00
Clayton Nummer
498da0e0db Use actual timezone to fix configured sunrise/sunset 2020-03-19 17:25:02 -04:00
Clayton Nummer
03718f0e3c Version bump for (deprecated) custom updater 2020-03-19 15:49:30 -04:00
Clayton Nummer
9e1d140e19 Use the same timezone for "now" time and configured lat/long 2020-03-19 15:48:52 -04:00
Clayton Nummer
abe47adc86 Version bump for (deprecated) custom updater 2020-03-07 10:16:13 -05:00
Clayton Nummer
6c26f5dbe1 Version bump for (deprecated) custom updater 2020-02-21 22:16:31 -05:00
Clayton Nummer
db7d0574dd Bump version for services hotfix, and fix typo 2020-02-12 23:04:10 -05: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'
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 2019-07-30 18:25:42 -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
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