Closed bouwew closed 3 weeks ago
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 100.00%. Comparing base (
67ba9a2
) to head (56d8f7d
). Report is 5 commits behind head on main.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
The recent updates involve a significant semantic change across multiple JSON configuration files and Python scripts. The key "battery_state"
has been uniformly replaced with "low_battery"
to enhance clarity and specificity regarding the battery status of various devices. This adjustment improves the representation of battery conditions without altering any underlying functionality or control logic.
Files | Change Summary |
---|---|
fixtures/adam_*.json |
Replaced "battery_state" with "low_battery" in multiple instances across various device configurations to improve clarity on battery status indicating low conditions. |
plugwise/constants.py |
Added "low_battery" to the BinarySensorType and removed battery_state from the SmileBinarySensors , reflecting a refined approach to battery monitoring. |
plugwise/data.py |
Updated methods to replace "battery_state" with "low_battery" in condition checks and assignments, streamlining battery status monitoring. |
plugwise/util.py |
Modified the common_match_cases function to set "low_battery" instead of "battery_state" in the data dictionary, adjusting how battery status is represented. |
tests/data/adam/*.json |
Altered tests to reflect the change from "battery_state" to "low_battery" for consistency in testing scenarios. |
CHANGELOG.md |
Documented the addition of the low_battery binary sensor and the transition from battery_state , indicating a semantic shift in battery monitoring. |
pyproject.toml |
Updated project version from "1.1.0a0" to "1.1.0" , marking a transition to a stable release. |
sequenceDiagram
participant User
participant Device
participant BatteryMonitor
User->>Device: Request status
Device->>BatteryMonitor: Check low_battery status
BatteryMonitor-->>Device: Return low_battery information
Device-->>User: Provide low_battery alert
Hop, hop, hooray, a change we adore,
Low battery whispers, "I’m here to explore!"
From state to low, we leap with delight,
Clarity shines in the day and the night.
With every new key, our mission stays clear,
For happy devices, we bring lots of cheer! 🐇✨
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Issues
0 New issues
0 Accepted issues
Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code
In the backend code
low_battery
beingTrue/False
"reads" better.But in the Integration I think we should stick to
Battery State
now with thedevice_class
added. Not a big problem, we can useBATTERY_STATE: Final = "low_battery"
as constant.@CoMPaTech what's your opinion?
Summary by CodeRabbit
New Features
battery_state
tolow_battery
across multiple devices, enhancing clarity on low battery conditions.Bug Fixes
Tests
Chores