forked from Blendman974/faceclaw
Make iOS app main screen match the Android UI
This commit is contained in:
1 parent
9f53847bb7
commit
6c3144cc31
30 files changed
+1013
-439
No files matched your search
@@ -0,0 +1,8 @@
|
||||
import { bytes, concat, integer } from './ble-protocol'
|
||||
|
||||
/** Same G2SettingPackage as Kotlin BleProtocol.buildSetBrightness. */
|
||||
export function setBrightness(magic: number, level: number | null): Uint8Array {
|
||||
const fields = level === null ? integer(1, 1)
|
||||
: concat(integer(1, 0), integer(2, Math.max(0, Math.min(100, Math.round(level)))))
|
||||
return concat(integer(1, 1), integer(2, magic), bytes(3, bytes(1, fields)))
|
||||
}
|
||||
Reference in new issue
Block a user