tangled
alpha
login
or
join now
zzstoatzz.io
/
solux
0
fork
atom
this repo has no description
0
fork
atom
overview
issues
pulls
pipelines
dim all phases - cap brightness at 120
zzstoatzz.io
2 months ago
1d3a1e60
84fc4f7f
+18
-10
2 changed files
expand all
collapse all
unified
split
.env.example
src
solux
controller.py
+7
.env.example
···
1
1
+
# prefect cloud credentials (from `prefect profile inspect pond`)
2
2
+
PREFECT_API_URL=https://api.prefect.cloud/api/accounts/.../workspaces/...
3
3
+
PREFECT_API_KEY=pnu_...
4
4
+
5
5
+
# hue bridge credentials
6
6
+
HUE_BRIDGE_IP=192.168.0.165
7
7
+
HUE_BRIDGE_USERNAME=your-username-here
+11
-10
src/solux/controller.py
···
28
28
29
29
30
30
# lighting phases anchored to sun position
31
31
+
# brightness capped at 120 - never too bright
31
32
PHASES: list[Phase] = [
32
33
Phase(
33
34
name="dawn",
34
35
get_start=lambda s: s.dawn,
35
35
-
state=LightState(bri=80, ct=400),
36
36
+
state=LightState(bri=40, ct=400),
36
37
),
37
38
Phase(
38
39
name="sunrise",
39
40
get_start=lambda s: s.sunrise,
40
40
-
state=LightState(bri=180, ct=300),
41
41
+
state=LightState(bri=80, ct=300),
41
42
),
42
43
Phase(
43
44
name="morning",
44
45
get_start=lambda s: s.sunrise + timedelta(hours=1),
45
45
-
state=LightState(bri=254, ct=220),
46
46
+
state=LightState(bri=120, ct=220),
46
47
),
47
48
Phase(
48
49
name="midday",
49
50
get_start=lambda s: s.noon,
50
50
-
state=LightState(bri=254, ct=200),
51
51
+
state=LightState(bri=120, ct=200),
51
52
),
52
53
Phase(
53
54
name="afternoon",
54
55
get_start=lambda s: s.noon + timedelta(hours=3),
55
55
-
state=LightState(bri=230, ct=280),
56
56
+
state=LightState(bri=100, ct=280),
56
57
),
57
58
Phase(
58
59
name="golden_hour",
59
60
get_start=lambda s: s.sunset - timedelta(hours=1),
60
60
-
state=LightState(bri=180, ct=370),
61
61
+
state=LightState(bri=80, ct=370),
61
62
),
62
63
Phase(
63
64
name="sunset",
64
65
get_start=lambda s: s.sunset,
65
65
-
state=LightState(bri=120, ct=420),
66
66
+
state=LightState(bri=60, ct=420),
66
67
),
67
68
Phase(
68
69
name="dusk",
69
70
get_start=lambda s: s.dusk,
70
70
-
state=LightState(bri=80, ct=470),
71
71
+
state=LightState(bri=40, ct=470),
71
72
),
72
73
Phase(
73
74
name="evening",
74
75
get_start=lambda s: s.dusk + timedelta(hours=1),
75
75
-
state=LightState(bri=50, ct=500),
76
76
+
state=LightState(bri=30, ct=500),
76
77
),
77
78
Phase(
78
79
name="night",
79
80
get_start=lambda s: s.dusk + timedelta(hours=3),
80
80
-
state=LightState(bri=25, ct=500),
81
81
+
state=LightState(bri=15, ct=500),
81
82
),
82
83
]
83
84