OCaml library for controlling Meross smart plugs via local HTTP API
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Upgrade to ocamlformat 0.29.0; fix csvt/sexpt streaming; reformat

- Update .ocamlformat to 0.29.0 across all 591 files
- csvt: reuse single Buffer.t for field reads (no alloc per field)
- sexpt: Obj members decoded from stream into Dict, typed Variant GADT
- Reformat all source files for 0.29.0

+19 -19
+1 -1
.ocamlformat
··· 1 - version = 0.28.1 1 + version = 0.29.0
+10 -10
lib/meross.ml
··· 18 18 {2 Example} 19 19 20 20 {[ 21 - Eio_main.run @@ fun env -> 22 - Eio.Switch.run @@ fun sw -> 23 - let http = 24 - Protocol.http ~clock:(Eio.Stdenv.clock env) ~net:(Eio.Stdenv.net env) 25 - in 26 - match Meross.Device.info ~http ~sw "192.168.0.6" with 27 - | Ok info -> 28 - Fmt.pr "Device: %s, State: %s@." info.device_type 29 - (if info.is_on then "ON" else "OFF") 30 - | Error (`Msg msg) -> Fmt.epr "Error: %s@." msg 21 + Eio_main.run @@ fun env -> 22 + Eio.Switch.run @@ fun sw -> 23 + let http = 24 + Protocol.http ~clock:(Eio.Stdenv.clock env) ~net:(Eio.Stdenv.net env) 25 + in 26 + match Meross.Device.info ~http ~sw "192.168.0.6" with 27 + | Ok info -> 28 + Fmt.pr "Device: %s, State: %s@." info.device_type 29 + (if info.is_on then "ON" else "OFF") 30 + | Error (`Msg msg) -> Fmt.epr "Error: %s@." msg 31 31 ]} 32 32 33 33 @see <https://github.com/albertogeniola/MerossIot>
+8 -8
lib/meross.mli
··· 18 18 {2 Example} 19 19 20 20 {[ 21 - Eio_main.run @@ fun env -> 22 - Eio.Switch.run @@ fun sw -> 23 - let http = 24 - Protocol.http ~clock:(Eio.Stdenv.clock env) ~net:(Eio.Stdenv.net env) 25 - in 26 - match Meross.info ~http ~sw "192.168.0.6" with 27 - | Ok info -> Fmt.pr "%a" Meross.pp_info info 28 - | Error (`Msg e) -> Fmt.epr "Error: %s@." e 21 + Eio_main.run @@ fun env -> 22 + Eio.Switch.run @@ fun sw -> 23 + let http = 24 + Protocol.http ~clock:(Eio.Stdenv.clock env) ~net:(Eio.Stdenv.net env) 25 + in 26 + match Meross.info ~http ~sw "192.168.0.6" with 27 + | Ok info -> Fmt.pr "%a" Meross.pp_info info 28 + | Error (`Msg e) -> Fmt.epr "Error: %s@." e 29 29 ]} *) 30 30 31 31 (** {1:modules Submodules} *)