-
-
Notifications
You must be signed in to change notification settings - Fork 63
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
Events on ha context #478
Events on ha context #478
Conversation
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.
Approving this if you think we should change the namespace do it before merge.
eventProvider.GetEventDataOfType<ZhaEventData>("zha_event") | ||
.Where(e => e.DeviceIeee == "84:71:27:ff:fe:40:78:7b") | ||
.Subscribe(e => Console.WriteLine($"device {e.DeviceIeee} sent command: { e.Command} endpoint: {e.EndpointId}")); | ||
ha.Events.Filter<ZhaEventData>("zha_event") |
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.
Ohh I really like the use of "Filter". We could always be even more specific in the Where clause if we need to.
using System; | ||
using System.Text.Json; | ||
|
||
namespace NetDaemon.Model3.Common |
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.
Should we use HassModel as namespace instead of Model3?
using NetDaemon.Model3.Entities; | ||
using System; | ||
using System.Reactive.Linq; | ||
using NetDaemon.Model3.Entities; | ||
|
||
namespace NetDaemon.Model3.Common |
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.
Same here. All Model3 -> HassModel
* Added Events to IHaContext * Remove unused variable * Fix comment
* Added Events to IHaContext * Remove unused variable * Fix comment
Re-added because it was lost in a merge conflict
* Added Events to IHaContext * Remove unused variable * Fix comment
Re-added because it was lost in a merge conflict
Breaking change
Proposed change
Type of change
Additional information
Checklist
If user exposed functionality or configuration variables are added/changed: