feat(v0.4): проводка thermal+coprocessor циклов + D-Bus ThermalState/ThermalChanged + dev-mock

spawn_loops (thermal-монитор + coprocessor heartbeat/wait/safe-to-cut/B09) в main после
регистрации интерфейса; PowerService += thermal_state + хендлы fsm/thermal_state + mock(temp,copro);
dev-mock += SetTemp/HangSoc/McuLinkLoss; proxy.rs += thermal_state/thermal_changed. Existing
integration-тесты подогнаны под mock(temp,copro).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Alexander <akotenev2003@gmail.com>
This commit is contained in:
2026-06-25 15:36:19 +03:00
parent 2e6144c54f
commit cd2442f672
4 changed files with 182 additions and 7 deletions
@@ -3,14 +3,17 @@
use futures_util::StreamExt;
use shturman_ipc::{names, types::PowerState};
use shturman_power::coprocessor::MockCoprocessor;
use shturman_power::thermal::MockTempSource;
use shturman_power::PowerService;
use shturman_sdk::PowerClient;
use std::sync::Arc;
#[tokio::test]
#[ignore = "нужна session-шина: just test-integration"]
async fn power_state_and_fake_acc() {
let svc = PowerService::new();
let mock = svc.mock();
let mock = svc.mock(Arc::new(MockTempSource::new(20)), Arc::new(MockCoprocessor::new()));
// сервер: Power1 + dev.PowerMock1 на одном пути (владеет ru.shturman.Power)
let server = zbus::Connection::session().await.unwrap();
@@ -53,7 +56,7 @@ async fn power_state_and_fake_acc() {
#[ignore = "нужна session-шина: just test-integration"]
async fn shutdown_imminent_then_abort() {
let svc = PowerService::new();
let mock = svc.mock();
let mock = svc.mock(Arc::new(MockTempSource::new(20)), Arc::new(MockCoprocessor::new()));
let server = zbus::Connection::session().await.unwrap();
server
.object_server()