v1.0.1
Enhanced the Mycodo integration by refactoring the sensor and switch setup logic to improve robustness and maintainability. Centralized the sensor-related logic in utils.py and ensured that the system gracefully handles cases where switch data might be None.
Changes:
- Moved
async_setup_entry
logic from sensor.py into utils.py to centralize sensor setup and updates. - Modified MycodoClient in utils.py to include error handling and support for dynamic sensor and switch updates.
- Updated sensor setup to handle potential None values in switch data using
switches.get("output devices", []) or []
. - Streamlined HTTP request methods within MycodoClient and added detailed logging for error tracking.
This refactor improves the stability of the integration and paves the way for future enhancements.
Full Changelog: V1.0.0...v1.0.1