-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[automower] Implementation of complete automower API #17545
Conversation
@lsiepel, do you have a good example how to implement dynamic Channels and Channel Groups? Esp. dynamic Channel Groups seems to be tricky. |
Interesting combination, don't have an example straight out of my head, let me check. |
Except from dynamic channels and channel groups (which is an usability improvement only), I would consider the main part of the implementation is done. |
Implementation done - ready for review |
In the meanwhile also dynamic channels are implemented. The issue reported in openhab/openhab-webui#575 seems to be not fixed, when the channels are generated automatically. As workaround I'm adding dynamic Channel Labels as well. The Labels are then used to create unique channel uids:
@lsiepel, Is it worth creating an issue? |
@lsiepel, will you find time to review this major change set as well? thanks in advance! |
Not sure if i understand the problem here. You should make sure the channelUID is unique, The label is just for display and while it woudl be very usefull, it is not constraint to be unique.
In the meantime, could you fix the conflict? |
The channelUID is already unique due to the running index. The Label was not unique and repeating per message ( I think this is the code how the item names are proposed:
It is using the As an improvement we could request that openHAB UI implements a duplication check at this stage. Nevertheless the code works as expected / intended. This is how the current implementation using the workaround looks like: I'm happy with that implementation in the binding. No need to change. |
In December I got an email from Husqvarna that there will be changes in the APIs and the backend. Has anyone tested the binding with this new version? Old version will only be available until 28th of February 2025. |
This change will affect Automower Connect Websocket API (new v2). The Automower Connect REST API will stay the same. This binding is using REST API only. Therefore it's not affected. |
Could you fix the conflixct? |
#18061 on main is the reason for the conflict. What is the best approach with least effort to resolve the conflict? |
I would cascade all upstream commits: update your main from openhab main, afterwards update your feature branch from your main etc. Eventually your IDE will show you the conflict and ask for resolving it. If it's only the license header it would be easy to fix. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a minor comment. As this is an extensive PR, i would like to double check that
- this is very well tested?
- the update instructions can't fix everything, i think an upgrade notice is mandatory.
<!-- optional channels | ||
<add-channel id="<xx>-start" groupIds="calendartasks"> | ||
<type>automower:calendarTasksStartType</type> | ||
</add-channel> | ||
<add-channel id="<xx>-duration" groupIds="calendartasks"> | ||
<type>automower:calendarTasksDurationType</type> | ||
</add-channel> | ||
<add-channel id="<xx>-monday" groupIds="calendartasks"> | ||
<type>automower:calendarTasksMondayType</type> | ||
</add-channel> | ||
<add-channel id="<xx>-tuesday" groupIds="calendartasks"> | ||
<type>automower:calendarTasksTuesdayType</type> | ||
</add-channel> | ||
<add-channel id="<xx>-wednesday" groupIds="calendartasks"> | ||
<type>automower:calendarTasksWednesdayType</type> | ||
</add-channel> | ||
<add-channel id="<xx>-thursday" groupIds="calendartasks"> | ||
<type>automower:calendarTasksThursdayType</type> | ||
</add-channel> | ||
<add-channel id="<xx>-friday" groupIds="calendartasks"> | ||
<type>automower:calendarTasksFridayType</type> | ||
</add-channel> | ||
<add-channel id="<xx>-saturday" groupIds="calendartasks"> | ||
<type>automower:calendarTasksSaturdayType</type> | ||
</add-channel> | ||
<add-channel id="<xx>-sunday" groupIds="calendartasks"> | ||
<type>automower:calendarTasksSundayType</type> | ||
</add-channel> | ||
<add-channel id="<xx>-workAreaId" groupIds="calendartasks"> | ||
<type>automower:calendarTasksWorkAreaIdType</type> | ||
</add-channel> | ||
<add-channel id="<xx>-workArea" groupIds="calendartasks"> | ||
<type>automower:workareaNameType</type> | ||
</add-channel> | ||
--> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use er remove.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed channels that are dynamically handled by the binding and therefore not specified in the update instruction.
Signed-off-by: Michael Weger <weger.michael@gmx.net>
Signed-off-by: Michael Weger <weger.michael@gmx.net>
Signed-off-by: Michael Weger <weger.michael@gmx.net>
…utomower-connect-api?tab=releases) Signed-off-by: Michael Weger <weger.michael@gmx.net>
Signed-off-by: Michael Weger <weger.michael@gmx.net>
set several channels to advance added update.xml Signed-off-by: Michael Weger <weger.michael@gmx.net>
Signed-off-by: Michael Weger <weger.michael@gmx.net>
Signed-off-by: Michael Weger <weger.michael@gmx.net>
added poll channels tests and smaller fixes creating all channels at once due to performance issues Signed-off-by: Michael Weger <weger.michael@gmx.net>
Signed-off-by: Michael Weger <weger.michael@gmx.net>
b6853d4
to
543d922
Compare
Signed-off-by: Michael Weger <weger.michael@gmx.net>
Only the failed build due to the factory not adding the timezoneprovider to the handler constructor. |
updating header to 2025 for new files Signed-off-by: Michael Weger <weger.michael@gmx.net>
Slowly but surely ... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, LGTM.
Do you need additional time to test the latest changes?
As this is a breaking change and the Thing needs to be recreated to have everything setup right, i would like to ask you to create an upgrade notice in the distro repository.
} | ||
|
||
@Override | ||
public void handleCommand(ChannelUID channelUID, Command command) { | ||
if (RefreshType.REFRESH == command) { | ||
logger.debug("Refreshing channel '{}'", channelUID); | ||
refreshChannels(channelUID); | ||
// refreshChannels(channelUID); // causes >100 channel updates during setup |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left by mistake? Log says "Refreshing channel", so something seems not fully right now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed the logger as well as the commented refreshChannels
call:
if (RefreshType.REFRESH == command) {
// not implemented as it would causes >100 channel updates in a row during setup (performance)
} else {
....automower/src/main/java/org/openhab/binding/automower/internal/things/AutomowerHandler.java
Outdated
Show resolved
Hide resolved
....automower/src/main/java/org/openhab/binding/automower/internal/things/AutomowerHandler.java
Outdated
Show resolved
Hide resolved
...va/org/openhab/binding/automower/internal/rest/api/automowerconnect/AutomowerConnectApi.java
Outdated
Show resolved
Hide resolved
...va/org/openhab/binding/automower/internal/rest/api/automowerconnect/AutomowerConnectApi.java
Outdated
Show resolved
Hide resolved
The initial implementation was tested quite allot and I'm also using it since then w/o issue. Is there a known deadline to meet for the next (5.0.0) release? |
Deadline will be somewhere at the end of june i guess. But prefereably we add it before in a milestone to get some mileage and be sure all is stable before the mayor release. No rush, we have plenty of time. |
The thing must not be re-created (remove and re-add thing). But new channels have to linked to items (if they shall be used). I will create an upgrade notice for that. |
Signed-off-by: Michael Weger <weger.michael@gmx.net>
done |
[automower] Implementation of complete automower API
References:
Current Status / TODOs:
1.1 DONE
2.1 DONE /mowers/{id}/actions
2.2 DONE /mowers/{id}/calendar
2.3 DONE /mowers/{id}/errors/confirm
2.4 DONE /mowers/{id}/settings
2.5 DONE /mowers/{id}/stayOutZones/{stayOutId}
2.6 DONE /mowers/{id}/workAreas/{workAreaId}
2.7 DONE /mowers/{id}/workAreas/{workAreaId}/calendar
2.8 DONE /mowers/{id}/messages
3.1 DONE
4.1 DONE
5.1 DONE
6.1 DONE
7.1 DONE
8.1 DONE
9.1 DONE
10.1 DONE