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

[mycroft] Initial contribution #11040

Merged

Conversation

dalgwen
Copy link
Contributor

@dalgwen dalgwen commented Jul 21, 2021

[mycroft] Initial Contribution

"Mycroft is the world’s leading open source voice assistant. It is private by default and completely customizable."
This binding will connect to Mycroft A.I. in order to control it or react to event by listening on the message bus.
Possibilies include :

  • Press a button in OpenHAB to wake Mycroft without using a wake word.
  • Simulate a voice command to launch a skill, as if you just spoke it
  • Send some text that Mycroft will say (Using its Text To Speach service)
  • Control the music player
  • Control the sound volume of Mycroft
  • React to all the aforementioned events ...
  • ... And send/receive all other kind of messages on the message bus

Here a link to the forum thread I opened.
Here a link to the JAR builded against 3.2.0

fixes #11033

Signed-off-by: Gwendal ROULLEAU [email protected]

@dalgwen dalgwen requested a review from a team as a code owner July 21, 2021 10:33
@dalgwen dalgwen changed the title [mycroft] Mycroft binding - Initial contrib (#11033) [mycroft] Mycroft binding - Initial contrib Jul 21, 2021
@dalgwen dalgwen force-pushed the 11033-mycroft_binding_initial_contribution branch 2 times, most recently from d8c1dd7 to 4691317 Compare July 21, 2021 10:53
@dalgwen dalgwen changed the title [mycroft] Mycroft binding - Initial contrib [mycroft] Initial contribution Jul 21, 2021
@fwolter fwolter added the new binding If someone has started to work on a binding. For a new binding PR. label Jul 25, 2021
Copy link
Contributor

@t2000 t2000 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you VERY much for contributing this binding.

I myself am still waiting for my Mark II...

However, its nice to see openHAB support for it. I just stumbled across your PR and since you had to wait for a while already, I thought I can help you in getting it merged.

Usually before I go deeper in the code, I have a look at the general idea on how it is implemented. Hence, I left my first comments all on the README file, so you can have a look at them and we can discuss them or you can directly address them if you do not have further questions.
So far the overall approach looks quite good which is why I only had some minor comments.

Once we agree how things should be implemented, I will go through the code and see if there are things which I can help you to improve as well.

bundles/org.openhab.binding.mycroft/README.md Outdated Show resolved Hide resolved
bundles/org.openhab.binding.mycroft/README.md Outdated Show resolved Hide resolved
bundles/org.openhab.binding.mycroft/README.md Outdated Show resolved Hide resolved
bundles/org.openhab.binding.mycroft/README.md Outdated Show resolved Hide resolved
bundles/org.openhab.binding.mycroft/README.md Show resolved Hide resolved
bundles/org.openhab.binding.mycroft/README.md Outdated Show resolved Hide resolved
bundles/org.openhab.binding.mycroft/README.md Outdated Show resolved Hide resolved
bundles/org.openhab.binding.mycroft/README.md Outdated Show resolved Hide resolved
bundles/org.openhab.binding.mycroft/README.md Outdated Show resolved Hide resolved
@kaikreuzer
Copy link
Member

Thanks for helping out on the review here @t2000! I'll happily be the second reviewer with the merge rights afterwards. 😄
Just as you, I am waiting since 3 years or so for my Mark II, still hoping it's gonna be shipped one day!
And of course many thanks to @dalgwen for the effort to implement this integration!

@dalgwen
Copy link
Contributor Author

dalgwen commented Nov 14, 2021

Many thanks to you, @t2000 and @kaikreuzer, for taking the time to review this binding. I'm happy to see it could be of some use to you, and I hope the situation at Mycroft will be resolved soon for the mark II to go to market and to your mailboxes !
I will commit some/all of the requested changes in a few minutes.

@dalgwen dalgwen force-pushed the 11033-mycroft_binding_initial_contribution branch 2 times, most recently from 706cfc8 to fefa134 Compare November 14, 2021 22:28
Copy link
Contributor

@t2000 t2000 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found some time and went through your code.

The overall quality of the code looks quite good, so I only have some minor comments.

Please have a look and address them in separate commits or just reply to my comment if anything is unclear.

@dalgwen dalgwen force-pushed the 11033-mycroft_binding_initial_contribution branch from 44df6b5 to c8ff528 Compare November 27, 2021 12:23
@t2000
Copy link
Contributor

t2000 commented Nov 29, 2021

Apart from that last question: #11040 (comment) I am fine with that MR now. Thank you very much for your efforts so far!

@t2000
Copy link
Contributor

t2000 commented Nov 30, 2021

Thanks for your answers, could you please rebase your commit onto the latest main branch again to resolve the conflicts?

@dalgwen dalgwen force-pushed the 11033-mycroft_binding_initial_contribution branch from c8ff528 to 0bca9f4 Compare December 1, 2021 08:12
@dalgwen
Copy link
Contributor Author

dalgwen commented Dec 1, 2021

Rebase done :)

@t2000
Copy link
Contributor

t2000 commented Dec 2, 2021

@dalgwen Thank you very much for your contribution. Unfortunately I am not one of the maintainers, but I am sure that your code is now in a pretty good state to be merged ;)

@kaikreuzer Since you have already volunteered to have a look at this PR: The stage is yours. I am almost sure that you will find some more tiny glitches, because you always do. :-) So please have a look at this PR, thanks.

Copy link
Member

@kaikreuzer kaikreuzer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution @dalgwen, it looks really good, I only have minor remarks, but nothing serious.

I am almost sure that you will find some more tiny glitches, because you always do.

I am always trying not to be too picky, but I somehow cannot help it - I end up with quite some list of further comments. 😉 But thanks for your review, @t2000, much appreciated!

bundles/org.openhab.binding.mycroft/README.md Outdated Show resolved Hide resolved
bundles/org.openhab.binding.mycroft/README.md Outdated Show resolved Hide resolved
bundles/org.openhab.binding.mycroft/README.md Outdated Show resolved Hide resolved

## Supported Things

The only thing managed by this binding is a Mycroft instance.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you name directly the thing type id here?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you also elaborate what an "instance" exactly could be (hardware / software)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't find a more suited world to describe "a Mycroft" (as you guessed, the world should encompass the hardware version, and the picroft version, and every kind of Mycroft running on any computer ?)
Do you have something in mind, or should I just go for a brief description behind "instance" ? I think will put a description, tell me if you'd rather something else.
"The only thing managed by this binding is a Mycroft instance. (e.g. Mark I/II, Picroft, or any other variant)"

bundles/org.openhab.binding.mycroft/README.md Show resolved Hide resolved
<channel id="speak" typeId="speak-channel"/>
<channel id="utterance" typeId="utterance-channel"/>
<channel id="player" typeId="player-channel"/>
<!-- <channel id="volume" typeId="volume-channel"/> -->
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<!-- <channel id="volume" typeId="volume-channel"/> -->
<!-- <channel id="volume" typeId="system.volume"/> -->

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

This binding will connect to Mycroft A.I. in order to control it or react to event by listening on the message bus.

Signed-off-by: Gwendal ROULLEAU <[email protected]>
Signed-off-by: Gwendal ROULLEAU <[email protected]>
Signed-off-by: Gwendal ROULLEAU <[email protected]>
Signed-off-by: Gwendal Roulleau <[email protected]>
Signed-off-by: Gwendal Roulleau <[email protected]>
Signed-off-by: Gwendal Roulleau <[email protected]>
Signed-off-by: Gwendal Roulleau <[email protected]>
Signed-off-by: Gwendal Roulleau <[email protected]>
@dalgwen dalgwen force-pushed the 11033-mycroft_binding_initial_contribution branch from 2c5c865 to c00f286 Compare December 31, 2021 01:06
Delete the duck channel
Workaround for Mycroft bad management of volume.

Signed-off-by: Gwendal Roulleau <[email protected]>
@dalgwen dalgwen force-pushed the 11033-mycroft_binding_initial_contribution branch from c00f286 to 684149f Compare December 31, 2021 01:13
@dalgwen
Copy link
Contributor Author

dalgwen commented Dec 31, 2021

Unless I missed something or the build failed, I think I dealt with all the comments 🎉
(one question remains : should I reactivate the volume channel ?).
I hope I didn't make any more mistakes.

Signed-off-by: Gwendal Roulleau <[email protected]>
@kaikreuzer
Copy link
Member

Thanks for your updates!

one question remains : should I reactivate the volume channel ?

I would say so, yes - thanks for your detailed explanation from which it seems as if this channel will be useful.

@kaikreuzer kaikreuzer added rebuild Triggers Jenkins PR build and removed rebuild Triggers Jenkins PR build labels Jan 9, 2022
Copy link
Member

@kaikreuzer kaikreuzer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, looks all wonderful to me now. 😄
@t2000 Do you want to have a last look before merging?

@t2000
Copy link
Contributor

t2000 commented Jan 10, 2022

@kaikreuzer I had a brief look on the latest changes. LGTM.

@dalgwen Thank you for your efforts and implementing the volume hack.

I am waiting for my Mark II to arrive, so I can finally test it (even though it doesn't look as cute as when it was originally announced and thus my gf doesn't like the look of it anymore...).

Copy link
Contributor

@t2000 t2000 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@kaikreuzer kaikreuzer merged commit 40b5932 into openhab:main Jan 10, 2022
@kaikreuzer kaikreuzer added this to the 3.3 milestone Jan 10, 2022
@lolodomo
Copy link
Contributor

Please create a subsequent PR to add the default translation properties file.
You can produce it simply by running this command : mvn i18n:generate-default-translations

@dalgwen dalgwen mentioned this pull request Jan 11, 2022
@dalgwen
Copy link
Contributor Author

dalgwen commented Jan 11, 2022

Please create a subsequent PR

I take this opportunity : Thank you for thinking about thing like that, and keeping the project clean !
Done in #12020.

@lolodomo
Copy link
Contributor

And finally, you could add your binding's logo to the openHAB website. See https://www.openhab.org/docs/developer/bindings/#add-your-binding-s-logo-to-the-openhab-website

moesterheld pushed a commit to moesterheld/openhab-addons that referenced this pull request Jan 18, 2022
This binding will connect to Mycroft A.I. in order to control it or react to event by listening on the message bus.

Signed-off-by: Gwendal Roulleau <[email protected]>
nemerdaud pushed a commit to nemerdaud/openhab-addons that referenced this pull request Jan 28, 2022
This binding will connect to Mycroft A.I. in order to control it or react to event by listening on the message bus.

Signed-off-by: Gwendal Roulleau <[email protected]>
NickWaterton pushed a commit to NickWaterton/openhab-addons that referenced this pull request Apr 27, 2022
This binding will connect to Mycroft A.I. in order to control it or react to event by listening on the message bus.

Signed-off-by: Gwendal Roulleau <[email protected]>
Signed-off-by: Nick Waterton <[email protected]>
andan67 pushed a commit to andan67/openhab-addons that referenced this pull request Nov 6, 2022
This binding will connect to Mycroft A.I. in order to control it or react to event by listening on the message bus.

Signed-off-by: Gwendal Roulleau <[email protected]>
andrasU pushed a commit to andrasU/openhab-addons that referenced this pull request Nov 12, 2022
This binding will connect to Mycroft A.I. in order to control it or react to event by listening on the message bus.

Signed-off-by: Gwendal Roulleau <[email protected]>
Signed-off-by: Andras Uhrin <[email protected]>
@dalgwen dalgwen deleted the 11033-mycroft_binding_initial_contribution branch December 29, 2022 22:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new binding If someone has started to work on a binding. For a new binding PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[mycroft] New binding
5 participants