Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix schedule ending at midnight and wrong rain status if plugin started when wet #11

Merged
merged 1 commit into from
Aug 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ Standby, Mowing, Going home, Charging, Border, Error
**Zone 4** - percentage of the start of zone 4

## Text
*Format of the text fields: Start and end time format HH:MM. Add Trim to mowe the border. ex. "06:15 - 17:00 Trim" or "06:15 - 17:00"*
*Format of the text fields: Start and end time format HH:MM. Add Trim to mowe the border. ex. "06:15 - 17:00 Trim", "06:15 - 17:00", "08:00 - 24:00" or whole day "00:00 - 24:00"*

**Schedule Monday** - Text field to update the moday schedule.

Expand Down
6 changes: 5 additions & 1 deletion custom_components/sunseeker/sunseeker.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ def InitValues(self) -> None:
self.rain_en = self.devicedata["data"].get("rainFlag")
self.rain_delay_set = int(self.devicedata["data"].get("rainDelayDuration"))
self.rain_delay_left = self.devicedata["data"].get("rainDelayLeft")
self.rain_status = int(self.devicedata["data"].get("rainStatusCode"))
if self.devicedata["data"].get("onlineFlag"):
self.deviceOnlineFlag = '{"online":"1"}'
self.zoneOpenFlag = self.settings["data"].get("zoneOpenFlag")
Expand Down Expand Up @@ -160,7 +161,10 @@ def UpdateFromMqtt(self, data, daynumber: int) -> None:
if Start is not None:
asc.start = time.strftime("%H:%M", time.gmtime(int(Start) * 60))[0:5]
if End is not None:
asc.end = time.strftime("%H:%M", time.gmtime(int(End) * 60))[0:5]
if int(End) == 1440:
asc.end = "24:00"
else:
asc.end = time.strftime("%H:%M", time.gmtime(int(End) * 60))[0:5]
if Trimming is not None:
asc.trim = Trimming

Expand Down