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.

Migrate from vendored crowbar to opam-pinned alcobar

- Remove vendored crowbar/ directory
- Replace all Crowbar references with Alcobar across 176 .ml files
- Update all fuzz dune files: crowbar → alcobar in libraries
- Remove 77 gen_corpus.ml files (alcobar handles corpus internally)
- Update dune-project files: crowbar → alcobar in dependencies
- Update merlint rules (e705, e726): Crowbar → Alcobar in checks,
docs, and examples
- Update merlint generated docs (index.html)

428 files changed, ~1200 lines removed net.

+5 -42
+2 -8
fuzz/dune
··· 6 6 (executable 7 7 (name fuzz) 8 8 (modules fuzz fuzz_meross) 9 - (libraries meross crowbar crypto-rng.unix)) 9 + (libraries meross alcobar crypto-rng.unix)) 10 10 11 11 (rule 12 12 (alias runtest) ··· 22 22 (= %{profile} afl)) 23 23 (deps 24 24 (source_tree corpus) 25 - fuzz.exe 26 - gen_corpus.exe) 25 + fuzz.exe) 27 26 (action 28 27 (echo "AFL fuzzer built: %{exe:fuzz.exe}\n"))) 29 - 30 - (executable 31 - (name gen_corpus) 32 - (modules gen_corpus) 33 - (libraries meross unix))
+1 -1
fuzz/fuzz.ml
··· 1 - let () = Crowbar.run "meross" [ Fuzz_meross.suite ] 1 + let () = Alcobar.run "meross" [ Fuzz_meross.suite ]
+1 -1
fuzz/fuzz_meross.ml
··· 3 3 SPDX-License-Identifier: MIT 4 4 ---------------------------------------------------------------------------*) 5 5 6 - open Crowbar 6 + open Alcobar 7 7 8 8 let () = Crypto_rng_unix.use_default () 9 9
+1 -1
fuzz/fuzz_meross.mli
··· 1 1 (** Fuzz tests for {!Meross}. *) 2 2 3 - val suite : string * Crowbar.test_case list 3 + val suite : string * Alcobar.test_case list 4 4 (** Test suite. *)
-31
fuzz/gen_corpus.ml
··· 1 - (** Generate seed corpus for meross fuzz testing. *) 2 - 3 - let () = 4 - (try Unix.mkdir "corpus" 0o755 5 - with Unix.Unix_error (Unix.EEXIST, _, _) -> ()); 6 - let write name data = 7 - let oc = open_out_bin (Filename.concat "corpus" name) in 8 - output_string oc data; 9 - close_out oc 10 - in 11 - (* Valid JSON header-like structure *) 12 - write "seed_000" 13 - {|{"from_":"","message_id":"abc","method_":"GET","namespace":"ns","payload_version":1,"sign":"x","timestamp":0}|}; 14 - (* Valid countdown JSON *) 15 - write "seed_001" {|{"onoff":1,"end_time":100,"duration":60}|}; 16 - (* Valid timer JSON *) 17 - write "seed_002" 18 - {|{"channel":0,"timer_type":1,"down":{"onoff":1,"end_time":100,"duration":60}}|}; 19 - (* Valid trigger rule JSON *) 20 - write "seed_003" {|{"week":127,"duration":3600}|}; 21 - (* Valid runtime JSON *) 22 - write "seed_004" {|{"signal":50}|}; 23 - (* Valid DND JSON *) 24 - write "seed_005" {|{"enabled":true}|}; 25 - (* Empty JSON *) 26 - write "seed_006" "{}"; 27 - (* Invalid JSON *) 28 - write "seed_007" "{not valid"; 29 - (* Empty *) 30 - write "seed_008" ""; 31 - print_endline "gen_corpus: wrote 9 meross seed files"