-
-
Notifications
You must be signed in to change notification settings - Fork 80
Mqtt extension to create an update entities in HA #658
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
Conversation
* Initial commit of MQTT entity management framework. Addable extension method `AddMqttExtensions()`, rough entity creation through `EntityUpdater` (which is probably a poor name) that needs more strongly-typed. * DI scope update from PR comment
Codecov Report
@@ Coverage Diff @@
## dev #658 +/- ##
==========================================
+ Coverage 80.71% 80.75% +0.03%
==========================================
Files 118 118
Lines 3039 3039
Branches 325 325
==========================================
+ Hits 2453 2454 +1
Misses 452 452
+ Partials 134 133 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
src/Extensions/NetDaemon.Extensions.MqttEntityManager/MqttConfiguration.cs
Show resolved
Hide resolved
src/Extensions/NetDaemon.Extensions.MqttEntityManager/MqttEntityManager.cs
Outdated
Show resolved
Hide resolved
src/Extensions/NetDaemon.Extensions.MqttEntityManager/MessageSender.cs
Outdated
Show resolved
Hide resolved
src/Extensions/NetDaemon.Extensions.MqttEntityManager/MessageSender.cs
Outdated
Show resolved
Hide resolved
src/Extensions/NetDaemon.Extensions.MqttEntityManager/IMqttEntityManager.cs
Outdated
Show resolved
Hide resolved
…o mqtt_extensions
… codes, so handle each case in a consistent manner by throwing a new MqttConnection or MqttPublish exception. Add try...catch to the test app so that we can see when exceptions are thrown in called methods.
2. Remove unused IConfiguration arg from MessageSender constructor
src/Extensions/NetDaemon.Extensions.MqttEntityManager/MqttEntityManager.cs
Outdated
Show resolved
Hide resolved
helto4real
left a comment
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.
I think we should use ConfigureAwait(false) and not supress those. Also keep only the interfaces used by users public.
src/Extensions/NetDaemon.Extensions.MqttEntityManager/IMessageSender.cs
Outdated
Show resolved
Hide resolved
src/Extensions/NetDaemon.Extensions.MqttEntityManager/MessageSender.cs
Outdated
Show resolved
Hide resolved
src/Extensions/NetDaemon.Extensions.MqttEntityManager/MessageSender.cs
Outdated
Show resolved
Hide resolved
src/Extensions/NetDaemon.Extensions.MqttEntityManager/MqttConfiguration.cs
Show resolved
Hide resolved
src/Extensions/NetDaemon.Extensions.MqttEntityManager/MqttConfiguration.cs
Outdated
Show resolved
Hide resolved
helto4real
left a comment
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.
Good job @eugeneniemand and @skotl really looking forward trying this!
* Initial commit of MQTT entity management framework. (net-daemon#656) * Initial commit of MQTT entity management framework. Addable extension method `AddMqttExtensions()`, rough entity creation through `EntityUpdater` (which is probably a poor name) that needs more strongly-typed. * DI scope update from PR comment * Added Update and Remove methods and resolved some of the comments for PR net-daemon#656 * Changing names to be less generic * Moved to src/extensions, renamed folder and fixed warning * Added example app and fixed IOptions for mqtt config * Fix CI Build error * Add support for nuget and default host (net-daemon#660) * Added Discovery prefix * MQTT connect and publish can throw exceptions as well as return error codes, so handle each case in a consistent manner by throwing a new MqttConnection or MqttPublish exception. Add try...catch to the test app so that we can see when exceptions are thrown in called methods. * 1. Add XML comments 2. Remove unused IConfiguration arg from MessageSender constructor * Resolving PR comments * Merged Skotl's code and fixed hard coded retain flag * Removing throw and fixed warning. Added comment for Delay * address PR comments * Internalising... Co-authored-by: Scott Leckie <scott.leckie@kwolo.com> Co-authored-by: Tomas Hellström <tomas.hellstrom@yahoo.se>
Breaking change
Proposed change
Type of change
Additional information
Checklist
If user exposed functionality or configuration variables are added/changed: