@@ -95,6 +95,7 @@ export type DeviceStatus = {
9595 musicEnv ?: number ;
9696 musicLevel ?: number ;
9797 musicKickMs ?: number ;
98+ notifyMin ?: number ;
9899 clapEnabled ?: boolean ;
99100 clapThreshold ?: number ;
100101 clapCooldownMs ?: number ;
@@ -148,6 +149,16 @@ export function parseStatusLine(line: string, setStatus: Dispatch<SetStateAction
148149 } ) ) ;
149150 return true ;
150151 }
152+ if ( line . startsWith ( '[Brightness]' ) ) {
153+ const match = line . match ( / B r i g h t n e s s \] \s * ( [ 0 - 9 . ] + ) / i) ;
154+ const val = match ? parseFloat ( match [ 1 ] ) : undefined ;
155+ setStatus ( ( s ) => ( {
156+ ...s ,
157+ brightness : Number . isFinite ( val ?? NaN ) ? val : s . brightness ,
158+ lastStatusAt : Date . now ( ) ,
159+ } ) ) ;
160+ return true ;
161+ }
151162 if ( line . startsWith ( 'STATUS' ) ) {
152163 const parts = line . split ( '|' ) . slice ( 1 ) ;
153164 const kv : Record < string , string > = { } ;
@@ -176,6 +187,7 @@ export function parseStatusLine(line: string, setStatus: Dispatch<SetStateAction
176187 const outputMode = kv . out ? ( kv . out . toLowerCase ( ) . startsWith ( 'ana' ) ? 'analog' : 'pwm' ) : undefined ;
177188 const hasMusic = kv . music ? isAvailable ( 'music' ) : s . hasMusic ;
178189 const hasPoti = kv . poti ? isAvailable ( 'poti' ) : s . hasPoti ;
190+ const notifyMin = kv . notif_min ? asNum ( 'notif_min' ) : s . notifyMin ;
179191 const potiVal = Object . prototype . hasOwnProperty . call ( kv , 'poti_val' ) ? asNum ( 'poti_val' ) : undefined ;
180192 const potiRaw = Object . prototype . hasOwnProperty . call ( kv , 'poti_raw' ) ? asInt ( 'poti_raw' ) : undefined ;
181193 const potiMin = Object . prototype . hasOwnProperty . call ( kv , 'poti_min' ) ? asNum ( 'poti_min' ) : undefined ;
@@ -284,6 +296,7 @@ export function parseStatusLine(line: string, setStatus: Dispatch<SetStateAction
284296 musicMode : kv . music_mode ?? s . musicMode ,
285297 musicMod : asNum ( 'music_mod' ) ?? s . musicMod ,
286298 musicKickMs : asNum ( 'music_kick_ms' ) ?? s . musicKickMs ,
299+ notifyMin,
287300 clapEnabled : kv . clap ? kv . clap . toUpperCase ( ) === 'ON' : hasMusic === false ? false : s . clapEnabled ,
288301 clapThreshold : asNum ( 'clap_thr' ) ?? s . clapThreshold ,
289302 clapCooldownMs : asInt ( 'clap_cool' ) ?? s . clapCooldownMs ,
0 commit comments