OPNsense integration with Home Assistant
Fix #378 - When calculating the systems boot time, the uptime was subtracted from the current timestamp. The timestamp included microseconds, the uptime not. This resulted in the calculated boot time's microseconds being purely dependent on the exact timing of the request. The timestamp seems to be rounded afterwards, resulting in it switching between two second values depending on the request taking place in the first half or the second half of a second. ~~This PR set's the current timestamps microseconds to zero, resulting in the calculated boot times μs always being zero as well. Rounding should therefore always result in the same value. ~~ A PR in OPNsense introduced a new API field "boottime" that returns the boottime as formatted strings with seconds precision, independently on the exact time of request. This PR now makes use of that field if available. Else, the calculation as used before is made.
This issue appears to be discussing a feature request or bug report related to the repository. Based on the content, it seems to be still under discussion. The issue was opened by eopo and has received 28 comments.