BatteryAlertModule + BatteryAlertService wired into app.module like
the weather module. Every BATTERY_CHECK_INTERVAL_MS (default 60 s) the
service scans the node state backing GET /api/nodes and broadcasts a
single-packet '⚠️ @!<8-hex> battery low: <X>% (<name>)' alert for every
node at or below BATTERY_ALERT_THRESHOLD percent (default 20, <= on
purpose) not alerted within BATTERY_ALERT_COOLDOWN_MS (default 6 h,
in-memory map — resets on restart). Sends ride the pinned send channel
via MeshService.sendText like every other bot send.
10 lines
320 B
TypeScript
10 lines
320 B
TypeScript
import { Module } from '@nestjs/common';
|
|
import { BatteryAlertModule } from './battery/battery.module.js';
|
|
import { MeshModule } from './mesh/mesh.module.js';
|
|
import { WeatherModule } from './weather/weather.module.js';
|
|
|
|
@Module({
|
|
imports: [MeshModule, WeatherModule, BatteryAlertModule],
|
|
})
|
|
export class AppModule {}
|