Pilot v2: Core implementation + battery telemetry

Major updates:
- Complete Rust rewrite (pilot-v2/) with working MQTT client
- Fixed MQTT event loop deadlock (background task pattern)
- Battery telemetry for Linux (auto-detected via /sys/class/power_supply)
- Home Assistant auto-discovery for all sensors and switches
- Comprehensive documentation (AVANCEMENT.md, CLAUDE.md, roadmap)
- Docker test environment with Mosquitto broker
- Helper scripts for development and testing

Features working:
 MQTT connectivity with LWT
 YAML configuration with validation
 Telemetry: CPU, memory, IP, battery (Linux)
 Commands: shutdown, reboot, sleep, screen (dry-run tested)
 HA discovery and integration
 Allowlist and cooldown protection

Ready for testing on real hardware.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
Gilles Soulier
2025-12-30 06:23:00 +01:00
parent b7e67c6501
commit c5381b7112
4453 changed files with 78647 additions and 0 deletions

View File

@@ -0,0 +1 @@
This file has an mtime of when this was started.

View File

@@ -0,0 +1,13 @@
cargo:rerun-if-changed=src/nightly.rs
cargo:rerun-if-env-changed=RUSTC_BOOTSTRAP
cargo:rustc-check-cfg=cfg(anyhow_build_probe)
cargo:rustc-check-cfg=cfg(anyhow_nightly_testing)
cargo:rustc-check-cfg=cfg(anyhow_no_clippy_format_args)
cargo:rustc-check-cfg=cfg(anyhow_no_core_error)
cargo:rustc-check-cfg=cfg(anyhow_no_core_unwind_safe)
cargo:rustc-check-cfg=cfg(anyhow_no_fmt_arguments_as_str)
cargo:rustc-check-cfg=cfg(anyhow_no_ptr_addr_of)
cargo:rustc-check-cfg=cfg(anyhow_no_unsafe_op_in_unsafe_fn_lint)
cargo:rustc-check-cfg=cfg(error_generic_member_access)
cargo:rustc-check-cfg=cfg(std_backtrace)
cargo:rustc-cfg=std_backtrace

View File

@@ -0,0 +1 @@
/home/gilles/projects/pilot/pilot-v2/target/debug/build/anyhow-7dffd08ca73f1c01/out

View File

@@ -0,0 +1,5 @@
/home/gilles/projects/pilot/pilot-v2/target/debug/build/anyhow-f0f8ac34947eb6de/build_script_build-f0f8ac34947eb6de.d: /home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/anyhow-1.0.100/build.rs
/home/gilles/projects/pilot/pilot-v2/target/debug/build/anyhow-f0f8ac34947eb6de/build_script_build-f0f8ac34947eb6de: /home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/anyhow-1.0.100/build.rs
/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/anyhow-1.0.100/build.rs:

View File

@@ -0,0 +1,5 @@
/home/gilles/projects/pilot/pilot-v2/target/debug/build/async-fs-0fc57937ef2ca20d/build_script_build-0fc57937ef2ca20d.d: /home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/async-fs-1.6.0/build.rs
/home/gilles/projects/pilot/pilot-v2/target/debug/build/async-fs-0fc57937ef2ca20d/build_script_build-0fc57937ef2ca20d: /home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/async-fs-1.6.0/build.rs
/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/async-fs-1.6.0/build.rs:

View File

@@ -0,0 +1 @@
This file has an mtime of when this was started.

View File

@@ -0,0 +1 @@
/home/gilles/projects/pilot/pilot-v2/target/debug/build/async-fs-b8e27f3fae80e0d0/out

View File

@@ -0,0 +1 @@
This file has an mtime of when this was started.

View File

@@ -0,0 +1 @@
/home/gilles/projects/pilot/pilot-v2/target/debug/build/async-io-7810898f58d6f91d/out

View File

@@ -0,0 +1,5 @@
/home/gilles/projects/pilot/pilot-v2/target/debug/build/async-io-efada4b51bbaa2f4/build_script_build-efada4b51bbaa2f4.d: /home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/async-io-1.13.0/build.rs
/home/gilles/projects/pilot/pilot-v2/target/debug/build/async-io-efada4b51bbaa2f4/build_script_build-efada4b51bbaa2f4: /home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/async-io-1.13.0/build.rs
/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/async-io-1.13.0/build.rs:

View File

@@ -0,0 +1,9 @@
/home/gilles/projects/pilot/pilot-v2/target/debug/build/crossbeam-utils-3facd263110404aa/build_script_build-3facd263110404aa.d: /home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/crossbeam-utils-0.8.21/build.rs /home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/crossbeam-utils-0.8.21/no_atomic.rs /home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/crossbeam-utils-0.8.21/build-common.rs
/home/gilles/projects/pilot/pilot-v2/target/debug/build/crossbeam-utils-3facd263110404aa/build_script_build-3facd263110404aa: /home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/crossbeam-utils-0.8.21/build.rs /home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/crossbeam-utils-0.8.21/no_atomic.rs /home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/crossbeam-utils-0.8.21/build-common.rs
/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/crossbeam-utils-0.8.21/build.rs:
/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/crossbeam-utils-0.8.21/no_atomic.rs:
/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/crossbeam-utils-0.8.21/build-common.rs:
# env-dep:CARGO_PKG_NAME=crossbeam-utils

View File

@@ -0,0 +1 @@
This file has an mtime of when this was started.

View File

@@ -0,0 +1,2 @@
cargo:rerun-if-changed=no_atomic.rs
cargo:rustc-check-cfg=cfg(crossbeam_no_atomic,crossbeam_sanitize_thread)

View File

@@ -0,0 +1 @@
/home/gilles/projects/pilot/pilot-v2/target/debug/build/crossbeam-utils-5593ca2e94a79bb0/out

View File

@@ -0,0 +1 @@
This file has an mtime of when this was started.

View File

@@ -0,0 +1 @@
cargo:rustc-cfg=relaxed_coherence

View File

@@ -0,0 +1 @@
/home/gilles/projects/pilot/pilot-v2/target/debug/build/generic-array-0e994d5e42b52327/out

View File

@@ -0,0 +1,5 @@
/home/gilles/projects/pilot/pilot-v2/target/debug/build/generic-array-fa0747d719f0609b/build_script_build-fa0747d719f0609b.d: /home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/generic-array-0.14.7/build.rs
/home/gilles/projects/pilot/pilot-v2/target/debug/build/generic-array-fa0747d719f0609b/build_script_build-fa0747d719f0609b: /home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/generic-array-0.14.7/build.rs
/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/generic-array-0.14.7/build.rs:

View File

@@ -0,0 +1 @@
This file has an mtime of when this was started.

View File

@@ -0,0 +1,3 @@
cargo:rustc-cfg=io_safety_is_in_std
cargo:rustc-cfg=panic_in_const_fn
cargo:rerun-if-changed=build.rs

View File

@@ -0,0 +1 @@
/home/gilles/projects/pilot/pilot-v2/target/debug/build/io-lifetimes-d63298f07c6f8a87/out

View File

@@ -0,0 +1,5 @@
/home/gilles/projects/pilot/pilot-v2/target/debug/build/io-lifetimes-ec906b65167d04aa/build_script_build-ec906b65167d04aa.d: /home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/io-lifetimes-1.0.11/build.rs
/home/gilles/projects/pilot/pilot-v2/target/debug/build/io-lifetimes-ec906b65167d04aa/build_script_build-ec906b65167d04aa: /home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/io-lifetimes-1.0.11/build.rs
/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/io-lifetimes-1.0.11/build.rs:

View File

@@ -0,0 +1,5 @@
/home/gilles/projects/pilot/pilot-v2/target/debug/build/libc-515302c9f7ea915b/build_script_build-515302c9f7ea915b.d: /home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/libc-0.2.178/build.rs
/home/gilles/projects/pilot/pilot-v2/target/debug/build/libc-515302c9f7ea915b/build_script_build-515302c9f7ea915b: /home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/libc-0.2.178/build.rs
/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/libc-0.2.178/build.rs:

View File

@@ -0,0 +1 @@
This file has an mtime of when this was started.

View File

@@ -0,0 +1,24 @@
cargo:rerun-if-changed=build.rs
cargo:rerun-if-env-changed=RUST_LIBC_UNSTABLE_FREEBSD_VERSION
cargo:rustc-cfg=freebsd12
cargo:rerun-if-env-changed=RUST_LIBC_UNSTABLE_MUSL_V1_2_3
cargo:rerun-if-env-changed=RUST_LIBC_UNSTABLE_LINUX_TIME_BITS64
cargo:rerun-if-env-changed=RUST_LIBC_UNSTABLE_GNU_FILE_OFFSET_BITS
cargo:rerun-if-env-changed=RUST_LIBC_UNSTABLE_GNU_TIME_BITS
cargo:rustc-check-cfg=cfg(emscripten_old_stat_abi)
cargo:rustc-check-cfg=cfg(espidf_time32)
cargo:rustc-check-cfg=cfg(freebsd10)
cargo:rustc-check-cfg=cfg(freebsd11)
cargo:rustc-check-cfg=cfg(freebsd12)
cargo:rustc-check-cfg=cfg(freebsd13)
cargo:rustc-check-cfg=cfg(freebsd14)
cargo:rustc-check-cfg=cfg(freebsd15)
cargo:rustc-check-cfg=cfg(gnu_file_offset_bits64)
cargo:rustc-check-cfg=cfg(gnu_time_bits64)
cargo:rustc-check-cfg=cfg(libc_deny_warnings)
cargo:rustc-check-cfg=cfg(linux_time_bits64)
cargo:rustc-check-cfg=cfg(musl_v1_2_3)
cargo:rustc-check-cfg=cfg(vxworks_lt_25_09)
cargo:rustc-check-cfg=cfg(target_os,values("switch","aix","ohos","hurd","rtems","visionos","nuttx","cygwin"))
cargo:rustc-check-cfg=cfg(target_env,values("illumos","wasi","aix","ohos","nto71_iosock","nto80"))
cargo:rustc-check-cfg=cfg(target_arch,values("loongarch64","mips32r6","mips64r6","csky"))

View File

@@ -0,0 +1 @@
/home/gilles/projects/pilot/pilot-v2/target/debug/build/libc-6cd598f8757615e0/out

View File

@@ -0,0 +1,5 @@
/home/gilles/projects/pilot/pilot-v2/target/debug/build/memoffset-13f5b9470251e33b/build_script_build-13f5b9470251e33b.d: /home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/memoffset-0.7.1/build.rs
/home/gilles/projects/pilot/pilot-v2/target/debug/build/memoffset-13f5b9470251e33b/build_script_build-13f5b9470251e33b: /home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/memoffset-0.7.1/build.rs
/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/memoffset-0.7.1/build.rs:

View File

@@ -0,0 +1 @@
This file has an mtime of when this was started.

View File

@@ -0,0 +1,5 @@
cargo:rustc-cfg=tuple_ty
cargo:rustc-cfg=allow_clippy
cargo:rustc-cfg=maybe_uninit
cargo:rustc-cfg=doctests
cargo:rustc-cfg=raw_ref_macros

View File

@@ -0,0 +1 @@
/home/gilles/projects/pilot/pilot-v2/target/debug/build/memoffset-b58be1b5f143483a/out

View File

@@ -0,0 +1,5 @@
/home/gilles/projects/pilot/pilot-v2/target/debug/build/parking_lot_core-a1f54925c42d264a/build_script_build-a1f54925c42d264a.d: /home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/parking_lot_core-0.9.12/build.rs
/home/gilles/projects/pilot/pilot-v2/target/debug/build/parking_lot_core-a1f54925c42d264a/build_script_build-a1f54925c42d264a: /home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/parking_lot_core-0.9.12/build.rs
/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/parking_lot_core-0.9.12/build.rs:

View File

@@ -0,0 +1 @@
This file has an mtime of when this was started.

View File

@@ -0,0 +1,2 @@
cargo:rerun-if-changed=build.rs
cargo:rustc-check-cfg=cfg(tsan_enabled)

View File

@@ -0,0 +1 @@
/home/gilles/projects/pilot/pilot-v2/target/debug/build/parking_lot_core-ffcaa5490a92af7a/out

View File

@@ -0,0 +1 @@
This file has an mtime of when this was started.

View File

@@ -0,0 +1 @@
/home/gilles/projects/pilot/pilot-v2/target/debug/build/polling-6e2bdb21b2a0cdd2/out

View File

@@ -0,0 +1,5 @@
/home/gilles/projects/pilot/pilot-v2/target/debug/build/polling-e1a2d9c2d1e94e5d/build_script_build-e1a2d9c2d1e94e5d.d: /home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/polling-2.8.0/build.rs
/home/gilles/projects/pilot/pilot-v2/target/debug/build/polling-e1a2d9c2d1e94e5d/build_script_build-e1a2d9c2d1e94e5d: /home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/polling-2.8.0/build.rs
/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/polling-2.8.0/build.rs:

View File

@@ -0,0 +1 @@
This file has an mtime of when this was started.

View File

@@ -0,0 +1,23 @@
cargo:rustc-check-cfg=cfg(fuzzing)
cargo:rustc-check-cfg=cfg(no_is_available)
cargo:rustc-check-cfg=cfg(no_literal_byte_character)
cargo:rustc-check-cfg=cfg(no_literal_c_string)
cargo:rustc-check-cfg=cfg(no_source_text)
cargo:rustc-check-cfg=cfg(proc_macro_span)
cargo:rustc-check-cfg=cfg(proc_macro_span_file)
cargo:rustc-check-cfg=cfg(proc_macro_span_location)
cargo:rustc-check-cfg=cfg(procmacro2_backtrace)
cargo:rustc-check-cfg=cfg(procmacro2_build_probe)
cargo:rustc-check-cfg=cfg(procmacro2_nightly_testing)
cargo:rustc-check-cfg=cfg(procmacro2_semver_exempt)
cargo:rustc-check-cfg=cfg(randomize_layout)
cargo:rustc-check-cfg=cfg(span_locations)
cargo:rustc-check-cfg=cfg(super_unstable)
cargo:rustc-check-cfg=cfg(wrap_proc_macro)
cargo:rerun-if-changed=src/probe/proc_macro_span.rs
cargo:rustc-cfg=wrap_proc_macro
cargo:rerun-if-changed=src/probe/proc_macro_span_location.rs
cargo:rustc-cfg=proc_macro_span_location
cargo:rerun-if-changed=src/probe/proc_macro_span_file.rs
cargo:rustc-cfg=proc_macro_span_file
cargo:rerun-if-env-changed=RUSTC_BOOTSTRAP

View File

@@ -0,0 +1 @@
/home/gilles/projects/pilot/pilot-v2/target/debug/build/proc-macro2-1f771d0061c655ef/out

View File

@@ -0,0 +1,5 @@
/home/gilles/projects/pilot/pilot-v2/target/debug/build/proc-macro2-4929f4a8bf24ddeb/build_script_build-4929f4a8bf24ddeb.d: /home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/proc-macro2-1.0.104/build.rs
/home/gilles/projects/pilot/pilot-v2/target/debug/build/proc-macro2-4929f4a8bf24ddeb/build_script_build-4929f4a8bf24ddeb: /home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/proc-macro2-1.0.104/build.rs
/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/proc-macro2-1.0.104/build.rs:

View File

@@ -0,0 +1,5 @@
/home/gilles/projects/pilot/pilot-v2/target/debug/build/quote-03d3df1af8178ab4/build_script_build-03d3df1af8178ab4.d: /home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/quote-1.0.42/build.rs
/home/gilles/projects/pilot/pilot-v2/target/debug/build/quote-03d3df1af8178ab4/build_script_build-03d3df1af8178ab4: /home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/quote-1.0.42/build.rs
/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/quote-1.0.42/build.rs:

View File

@@ -0,0 +1 @@
This file has an mtime of when this was started.

View File

@@ -0,0 +1,2 @@
cargo:rerun-if-changed=build.rs
cargo:rustc-check-cfg=cfg(no_diagnostic_namespace)

View File

@@ -0,0 +1 @@
/home/gilles/projects/pilot/pilot-v2/target/debug/build/quote-4fccd938ab7a0173/out

View File

@@ -0,0 +1,5 @@
/home/gilles/projects/pilot/pilot-v2/target/debug/build/rayon-core-1bc1ef21b7aae4c0/build_script_build-1bc1ef21b7aae4c0.d: /home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rayon-core-1.13.0/build.rs
/home/gilles/projects/pilot/pilot-v2/target/debug/build/rayon-core-1bc1ef21b7aae4c0/build_script_build-1bc1ef21b7aae4c0: /home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rayon-core-1.13.0/build.rs
/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/rayon-core-1.13.0/build.rs:

View File

@@ -0,0 +1 @@
This file has an mtime of when this was started.

View File

@@ -0,0 +1 @@
cargo:rerun-if-changed=build.rs

View File

@@ -0,0 +1 @@
/home/gilles/projects/pilot/pilot-v2/target/debug/build/rayon-core-c8581eef8cc27647/out

View File

@@ -0,0 +1,5 @@
/home/gilles/projects/pilot/pilot-v2/target/debug/build/ring-3d9fa119325871f2/build_script_build-3d9fa119325871f2.d: /home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/ring-0.17.14/build.rs
/home/gilles/projects/pilot/pilot-v2/target/debug/build/ring-3d9fa119325871f2/build_script_build-3d9fa119325871f2: /home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/ring-0.17.14/build.rs
/home/gilles/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/ring-0.17.14/build.rs:

View File

@@ -0,0 +1 @@
This file has an mtime of when this was started.

Some files were not shown because too many files have changed in this diff Show More