• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

maximunited / imou_life / 25079207558
90%

Build:
DEFAULT BRANCH: master
Ran 28 Apr 2026 09:44PM UTC
Jobs 3
Files 20
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

28 Apr 2026 09:42PM UTC coverage: 68.503% (-1.3%) from 69.84%
25079207558

push

github

web-flow
Refactor battery optimization and fix critical security issues (#8)

* feat: add CLAUDE.md and integrate Karpathy Guidelines

- Add comprehensive CLAUDE.md with project architecture and dev commands
- Install Karpathy Guidelines as git submodule for code quality
- Add .claude/skills/ documentation and setup instructions
- Update .gitignore to exclude local settings and junctions
- Clean up README.md version compatibility section
- Fix translation structure: data_description ? description in ca.json
- Add superpowers plugin configuration

The Karpathy Guidelines provide behavioral rules to reduce common
LLM coding mistakes: Think Before Coding, Simplicity First,
Surgical Changes, and Goal-Driven Execution.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

* feat: refactor battery optimization and fix critical issues

Battery Optimization Refactoring:
- Create ImouBatteryEntity base class to eliminate code duplication
- Remove unittest.mock from production code (was incorrectly used)
- Fix hardcoded mock data - now uses real coordinator data
- Complete API integration with proper fallback handling
- Add asyncio.Lock for thread-safe state mutations
- Make battery optimization methods public (enter_sleep_mode, exit_sleep_mode, etc.)
- Add public API wrappers for coordinator methods
- Use cached battery data to avoid redundant API calls
- Fix type hints: Dict[str, str] ? Dict[str, Any]

Critical Security and Error Handling Fixes:
- SECURITY: Remove hardcoded credentials from camera.py (rtsp://admin:yourpassword@...)
- Fix exception handling in __init__.py - preserve original exception context
- Add error message to UpdateFailed in coordinator.py for better debugging
- Add input validation for timeout parsing with try/except
- Use ValueError instead of generic Exception in switch.py

Test Updates:
- Update all battery tests to work with new base class
- Add AsyncMock for async_get_battery_status in conftest
- Fix method names: _enter_sleep_mode ? ... (continued)

164 of 232 new or added lines in 9 files covered. (70.69%)

6 existing lines in 3 files now uncovered.

796 of 1162 relevant lines covered (68.5%)

2.06 hits per line

Uncovered Changes

Lines Coverage ∆ File
45
78.15
-3.1% custom_components/imou_life/battery_coordinator.py
9
64.38
-7.62% custom_components/imou_life/battery_binary_sensor.py
8
67.94
-3.26% custom_components/imou_life/__init__.py
4
74.32
-10.2% custom_components/imou_life/battery_select.py
1
72.58
-12.3% custom_components/imou_life/battery_button.py
1
27.87
0.0% custom_components/imou_life/switch.py

Coverage Regressions

Lines Coverage ∆ File
3
72.58
-12.3% custom_components/imou_life/battery_button.py
2
74.32
-10.2% custom_components/imou_life/battery_select.py
1
64.38
-7.62% custom_components/imou_life/battery_binary_sensor.py
Jobs
ID Job ID Ran Files Coverage
1 run-3.13 - 25079207558.1 28 Apr 2026 09:44PM UTC 20
68.5
GitHub Action Run
2 run-3.12 - 25079207558.2 28 Apr 2026 09:44PM UTC 20
68.5
GitHub Action Run
3 run-3.11 - 25079207558.3 28 Apr 2026 09:44PM UTC 20
68.5
GitHub Action Run
Source Files on build 25079207558
  • Tree
  • List 20
  • Changed 8
  • Source Changed 8
  • Coverage Changed 7
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #25079207558
  • c5a5d809 on github
  • Prev Build on master (#20539737787)
  • Next Build on master (#25079310389)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc