Skip to content

Commit e8b0b0c

Browse files
authored
Color Control (#473)
... similar to Level Control and On-Off. **And quite complex!** With this, we should have a complete story for lights, where only a minimal effort is required by the implementors / integrators - implementing the Hooks traits. Still a few open topics to be solved later: - Persistence of a few attributes (also valid of Level Control and likely On-Off) - Enable all On-Off and Level Control tests (some are not part of the suite yet)
1 parent 1236da8 commit e8b0b0c

8 files changed

Lines changed: 4167 additions & 574 deletions

File tree

examples/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ astro-dnssd = ["rs-matter/astro-dnssd"]
5454
zeroconf = ["rs-matter/zeroconf"]
5555
avahi = ["rs-matter/zbus"]
5656
resolve = ["rs-matter/zbus"]
57-
chip-test = []
5857
test-tcp = ["rs-matter/large-buffers"]
5958
# Temporary fix for unexpected cfgs lint
6059
defmt = []

examples/src/bin/dimmable_light.pics

Lines changed: 0 additions & 68 deletions
This file was deleted.

examples/src/bin/dimmable_light.rs

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -99,21 +99,10 @@ fn main() -> Result<(), Error> {
9999
}
100100

101101
fn run() -> Result<(), Error> {
102-
#[cfg(not(feature = "chip-test"))]
103102
env_logger::init_from_env(
104103
env_logger::Env::default().filter_or(env_logger::DEFAULT_FILTER_ENV, "debug"),
105104
);
106105

107-
#[cfg(feature = "chip-test")]
108-
env_logger::builder()
109-
.format(|buf, record| {
110-
use std::io::Write;
111-
writeln!(buf, "{}: {}", record.level(), record.args())
112-
})
113-
.target(env_logger::Target::Stdout)
114-
.filter_level(::log::LevelFilter::Debug)
115-
.init();
116-
117106
info!(
118107
"Matter memory: Matter (BSS)={}B, IM Buffers (BSS)={}B, Subscriptions (BSS)={}B",
119108
core::mem::size_of::<Matter>(),
@@ -133,9 +122,6 @@ fn run() -> Result<(), Error> {
133122

134123
// Persistence
135124
let kv_buf = KV_BUF.uninit().init_zeroed().as_mut_slice();
136-
#[cfg(feature = "chip-test")]
137-
let mut kv = rs_matter::persist::FileKvBlobStore::new_default();
138-
#[cfg(not(feature = "chip-test"))]
139125
let mut kv = rs_matter::persist::DirKvBlobStore::new_default();
140126
futures_lite::future::block_on(matter.load_persist(&mut kv, kv_buf))?;
141127
futures_lite::future::block_on(events.load_persist(&mut kv, kv_buf))?;

examples/src/bin/light_tests.pics

Lines changed: 159 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,159 @@
1+
PICS_SDK_CI_ONLY=1
2+
# PICS values to be used when running the `light_tests` executable.
3+
# OnOff + LevelControl + ColorControl on EP1.
4+
5+
# ---- Level Control Cluster ----
6+
LVL.S=1
7+
LVL.S.F00=1
8+
LVL.S.F01=1
9+
LVL.S.F02=0
10+
LVL.S.A0000=1
11+
LVL.S.A0001=1
12+
LVL.S.A0002=1
13+
LVL.S.A0003=1
14+
LVL.S.A0005=0
15+
LVL.S.A0004=0
16+
LVL.S.A0006=0
17+
LVL.S.A000f=1
18+
LVL.S.A0010=1
19+
LVL.S.A0011=1
20+
LVL.S.A0012=1
21+
LVL.S.A0013=1
22+
LVL.S.A0014=1
23+
LVL.S.A4000=1
24+
LVL.S.C00.Rsp=1
25+
LVL.S.C01.Rsp=1
26+
LVL.S.C02.Rsp=1
27+
LVL.S.C03.Rsp=1
28+
LVL.S.C04.Rsp=1
29+
LVL.S.C05.Rsp=1
30+
LVL.S.C06.Rsp=1
31+
LVL.S.C07.Rsp=1
32+
LVL.S.C08.Rsp=0
33+
LVL.S.M.VarRate=1
34+
35+
LVL.C=0
36+
LVL.C.AM-READ=0
37+
LVL.C.AM-WRITE=0
38+
LVL.C.AO-READ=0
39+
LVL.C.AO-WRITE=0
40+
41+
# ---- On/Off Cluster ----
42+
OO.S=1
43+
OO.S.A0000=1
44+
OO.S.A4000=1
45+
OO.S.A4001=1
46+
OO.S.A4002=1
47+
OO.S.A4003=1
48+
OO.S.C00.Rsp=1
49+
OO.S.C01.Rsp=1
50+
OO.S.C02.Rsp=1
51+
OO.S.C40.Rsp=1
52+
OO.S.C41.Rsp=0
53+
OO.S.C42.Rsp=1
54+
OO.S.F00=1
55+
OO.S.F01=0
56+
OO.S.F02=0
57+
OO.M.ManuallyControlled=1
58+
59+
OO.C=0
60+
OO.C.C00.Tx=0
61+
OO.C.C01.Tx=0
62+
OO.C.C02.Tx=0
63+
OO.C.C40.Tx=0
64+
OO.C.C41.Tx=0
65+
OO.C.C42.Tx=0
66+
OO.C.AM-READ=0
67+
OO.C.AM-WRITE=0
68+
OO.C.AO-READ=0
69+
OO.C.AO-WRITE=0
70+
71+
# ---- Color Control Cluster ----
72+
CC.S=1
73+
# Features: HUE_AND_SATURATION, ENHANCED_HUE, COLOR_LOOP, XY, COLOR_TEMPERATURE.
74+
CC.S.F00=1
75+
CC.S.F01=1
76+
CC.S.F02=1
77+
CC.S.F03=1
78+
CC.S.F04=1
79+
80+
# Attributes — scenable + supported ones declared by `light_tests`.
81+
CC.S.A0000=1
82+
CC.S.A0001=1
83+
CC.S.A0002=1
84+
CC.S.A0003=1
85+
CC.S.A0004=1
86+
CC.S.A0005=0
87+
CC.S.A0006=0
88+
CC.S.A0007=1
89+
CC.S.A0008=1
90+
CC.S.A000f=1
91+
CC.S.A0010=1
92+
CC.S.A0011=0
93+
CC.S.A0012=0
94+
CC.S.A0013=0
95+
CC.S.A0015=0
96+
CC.S.A0016=0
97+
CC.S.A0017=0
98+
CC.S.A0019=0
99+
CC.S.A001a=0
100+
CC.S.A001b=0
101+
CC.S.A0020=0
102+
CC.S.A0021=0
103+
CC.S.A0022=0
104+
CC.S.A0024=0
105+
CC.S.A0025=0
106+
CC.S.A0026=0
107+
CC.S.A0028=0
108+
CC.S.A0029=0
109+
CC.S.A002a=0
110+
CC.S.A0030=0
111+
CC.S.A0031=0
112+
CC.S.A0032=0
113+
CC.S.A0033=0
114+
CC.S.A0034=0
115+
CC.S.A0036=0
116+
CC.S.A0037=0
117+
CC.S.A0038=0
118+
CC.S.A003a=0
119+
CC.S.A003b=0
120+
CC.S.A003c=0
121+
CC.S.A4000=1
122+
CC.S.A4001=1
123+
CC.S.A4002=1
124+
CC.S.A4003=1
125+
CC.S.A4004=1
126+
CC.S.A4005=1
127+
CC.S.A4006=1
128+
CC.S.A400a=1
129+
CC.S.A400b=1
130+
CC.S.A400c=1
131+
CC.S.A400d=1
132+
CC.S.A4010=1
133+
134+
# Commands — server response side.
135+
CC.S.C00.Rsp=1
136+
CC.S.C01.Rsp=1
137+
CC.S.C02.Rsp=1
138+
CC.S.C03.Rsp=1
139+
CC.S.C04.Rsp=1
140+
CC.S.C05.Rsp=1
141+
CC.S.C06.Rsp=1
142+
CC.S.C07.Rsp=1
143+
CC.S.C08.Rsp=1
144+
CC.S.C09.Rsp=1
145+
CC.S.C0a.Rsp=1
146+
CC.S.C40.Rsp=1
147+
CC.S.C41.Rsp=1
148+
CC.S.C42.Rsp=1
149+
CC.S.C43.Rsp=1
150+
CC.S.C44.Rsp=1
151+
CC.S.C47.Rsp=1
152+
CC.S.C4b.Rsp=1
153+
CC.S.C4c.Rsp=1
154+
155+
CC.C=0
156+
CC.C.AM-READ=0
157+
CC.C.AM-WRITE=0
158+
CC.C.AO-READ=0
159+
CC.C.AO-WRITE=0

0 commit comments

Comments
 (0)