thomluther / anker-solix-api

Python library for Anker Solix API
MIT License
74 stars 15 forks source link

Enhance set_home_load helper method with set_slot and add_slot capabilities #83

Closed thomluther closed 6 months ago

thomluther commented 6 months ago

The helper method needs some enhancements to support Home Assistant services for setting a new time slot from scratch and insert a time slot. When inserting, the adjacent time slots needs to be adjusted with their start and end times. Overlapped slots will be removed.

Furthermore the current slot parameter modifications needed enhancements to create new slots when the current time falls into a gap in the schedule. The method was also enhanced to copy and modify an existing time slots instead of creating a new one from scratch to avoid mismatch of timeslot names, which are set by the Anker App and is different per used app language. A new slot from scratch is only created when the schedule is completely empty, which can happen when wrong schedule structure is sent to the Api.