feat(tapo-agent): add schedule/countdown timer API support
- Fork tapo crate to add missing schedule/timer APIs - Add get_countdown_rules, get_schedule_rules, get_next_event methods - New readings: countdown_active, countdown_remain, schedule_count, schedule_active_count, next_event_time - Add local compilation to build script alongside cross-compilation - Implement offline polling - device collection continues when server disconnects - Add more device readings: on_time, signal_level, rssi, runtime_today/month, energy_month Vendored tapo fork in tapo-fork/ with minimal changes to add schedule APIs.
This commit is contained in:
@@ -114,11 +114,38 @@ declare -A TARGETS=(
|
||||
echo -e "${BLUE}Starting builds...${NC}"
|
||||
echo ""
|
||||
|
||||
# ============================================
|
||||
# Local/Native Build
|
||||
# ============================================
|
||||
|
||||
echo -e "${GREEN}Building for local/native target...${NC}"
|
||||
|
||||
# Get host target
|
||||
HOST_TARGET=$(rustc -vV | grep host | cut -d' ' -f2)
|
||||
|
||||
# Use separate target dir for local builds to avoid GLIBC conflicts with cross builds
|
||||
CARGO_TARGET_DIR=target-local cargo build --release -j $(nproc)
|
||||
|
||||
# Copy binary to dist folder
|
||||
cp "target-local/release/tapo-agent" "dist/tapo-agent-local-${HOST_TARGET}"
|
||||
|
||||
# Get binary size
|
||||
size=$(du -h "dist/tapo-agent-local-${HOST_TARGET}" | cut -f1)
|
||||
echo -e " → ${GREEN}dist/tapo-agent-local-${HOST_TARGET}${NC} ($size)"
|
||||
echo ""
|
||||
|
||||
# ============================================
|
||||
# Cross-Compilation Builds
|
||||
# ============================================
|
||||
|
||||
echo -e "${BLUE}Starting cross-compilation builds...${NC}"
|
||||
echo ""
|
||||
|
||||
for target in "${!TARGETS[@]}"; do
|
||||
name="${TARGETS[$target]}"
|
||||
echo -e "${GREEN}Building for $target ($name)...${NC}"
|
||||
|
||||
cross build --release --target "$target"
|
||||
cross build --release --target "$target" -j $(nproc)
|
||||
|
||||
# Copy binary to dist folder with descriptive name
|
||||
cp "target/$target/release/tapo-agent" "dist/tapo-agent-$name"
|
||||
|
||||
Reference in New Issue
Block a user