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

Events on ha context #478

Merged
merged 3 commits into from
Oct 19, 2021

Conversation

FrankBakkerNl
Copy link
Contributor

@FrankBakkerNl FrankBakkerNl commented Oct 15, 2021

Breaking change

Proposed change

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (which adds functionality to an existing integration)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue:
  • Link to documentation pull request:

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the [development checklist][dev-checklist]
  • The code compiles without warnings (code quality chek)
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

Copy link
Collaborator

@helto4real helto4real left a 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")
Copy link
Collaborator

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
Copy link
Collaborator

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
Copy link
Collaborator

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

@FrankBakkerNl FrankBakkerNl merged commit 102203b into net-daemon:remodel Oct 19, 2021
FrankBakkerNl added a commit to FrankBakkerNl/netdaemon that referenced this pull request Oct 24, 2021
* Added Events to IHaContext

* Remove unused variable

* Fix comment
helto4real pushed a commit that referenced this pull request Oct 26, 2021
* Added Events to IHaContext

* Remove unused variable

* Fix comment
FrankBakkerNl added a commit to FrankBakkerNl/netdaemon that referenced this pull request Oct 28, 2021
Re-added because it was lost in a merge conflict
FrankBakkerNl added a commit that referenced this pull request Oct 28, 2021
Re-added because it was lost in a merge conflict
Ikcelaks pushed a commit to Ikcelaks/netdaemon that referenced this pull request Dec 23, 2022
* Added Events to IHaContext

* Remove unused variable

* Fix comment
Ikcelaks pushed a commit to Ikcelaks/netdaemon that referenced this pull request Dec 23, 2022
Re-added because it was lost in a merge conflict
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants