remove unused rtc dependency - #429
Open
bartoszpierzchlewicz wants to merge 5 commits into
Open
Conversation
wmbus_meter.h included esphome/components/time/real_time_clock.h and declared a protected member `time::RealTimeClock *rtc;`. That member is never assigned or read anywhere in the repository - there is no set_rtc(), no time_id config option, and no reference to it in any .cpp file. Meter timestamps come from the wmbusmeters library, which uses the POSIX clock (localtime() in wmbus_common/meters.cpp), not the ESPHome RTC object. Because __init__.py declares neither DEPENDENCIES nor AUTO_LOAD for time, ESPHome does not copy the time component sources unless the user happens to have a time: block in their YAML, so any config without one fails to build with: fatal error: esphome/components/time/real_time_clock.h: No such file or directory. Removing the include and the dead member drops the hidden dependency with no functional change.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
wmbus_meter.h included esphome/components/time/real_time_clock.h and declared a protected member
time::RealTimeClock *rtc;. That member is never assigned or read anywhere in the repository - there is no set_rtc(), no time_id config option, and no reference to it in any .cpp file.Meter timestamps come from the wmbusmeters library, which uses the POSIX clock (localtime() in wmbus_common/meters.cpp), not the ESPHome RTC object. Because init.py declares neither DEPENDENCIES nor AUTO_LOAD for time, ESPHome does not copy the time component sources unless the user happens to have a time: block in their YAML, so any config without one fails to build with: fatal error: esphome/components/time/real_time_clock.h: No such file or directory.
Removing the include and the dead member drops the hidden dependency with no functional change.