Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Add and use time related constants #32065
Time units have been standardized throughout all integrations.
Follow up PR to #31781
Adding some constants that are time related to be consistent in the unit of measurement.
Type of change
Example entry for
@@ Coverage Diff @@ ## dev #32065 +/- ## ========================================== + Coverage 94.71% 94.72% +0.01% ========================================== Files 766 767 +1 Lines 55568 55483 -85 ========================================== - Hits 52630 52557 -73 + Misses 2938 2926 -12
rohankapoorcom left a comment
Overall, looks good to me. I think there's one outstanding change that @scop already requested, otherwise this seems ready.
Regarding marking it as a breaking change, I think it's worth writing out something indicating that all of the time units have been standardized, providing the list of standardized units and saying that if you were using a non standard one in an automation or sensor or something, it has now been changed.
Do we have a linter or anything that can make sure that we caught all occurrences of these and converted them to constants?
Would be great if we'd have a tool to help against magic strings creeping in in the future. That'd be a difficult task to do robustly, though.
I happened to have a local in-progress branch for the same change, I'll do a quick diff to see if there were any.
BTW, JFYI, I have a WIP branch that addresses additional area, mass, concentration, speed, volume, and some other units here and there. I'll rebase once this in and file a PR.
Sounds great! FYI I have opened another PR #32094 for the percentage sign.