Skip to content

Commit

Permalink
Adjust the method used for time synchronization in Solis Modbus
Browse files Browse the repository at this point in the history
The controller's `write_holding_register` method is modified from writing only the seconds to writing the hours, minutes, and seconds. This change will improve the accuracy of time synchronization in the Solis Modbus component as it will not solely rely on the seconds.
  • Loading branch information
Pho3niX90 committed Mar 12, 2024
1 parent 6a5d784 commit dc2998f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion custom_components/solis_modbus/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -757,7 +757,7 @@ def clock_drift_test(controller, hours, minutes, seconds):

if abs(total_drift) > 5:
_LOGGER.info(f"inverter time {hours}:{minutes}:{seconds}. drift = {d_hours}:{d_minutes}:{d_seconds}, adjusting")
controller.write_holding_register(43005, current_time.second)
controller.write_holding_registers(43003, [current_time.hour, current_time.minute, current_time.second])
else:
_LOGGER.debug(f"inverter time {hours}:{minutes}:{seconds}. drift = {d_hours}:{d_minutes}:{d_seconds}")

Expand Down

0 comments on commit dc2998f

Please sign in to comment.