-
-
Notifications
You must be signed in to change notification settings - Fork 61
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
Ability to have sensor entities or binary entities as parameters to read from yaml for an app #310
Conversation
…tor to only generate new entities if not in the common selection and if possible inherit from a common service or else the RxEntityBase
Implemented the requested feature net-daemon#307
…sorEntities_or_BinaryEntities_as_parameters_to_read_from_YAML_for_an_App' into features/307-Ability_to_have_SensorEntities_or_BinaryEntities_as_parameters_to_read_from_YAML_for_an_App
|
CallService("group", "reload", data, false); | ||
} | ||
|
||
public void Set(dynamic? data = null) |
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.
Fix the warnings please. I try to keep the code base free from warnings as a way to keep the code quality consistent
…rameters to read from yaml for an app (net-daemon#310) * Initial commit, stiil need to write tests * refactored common stuff into RxEntityBase also adapted the codegenerator to only generate new entities if not in the common selection and if possible inherit from a common service or else the RxEntityBase * Ability to have Entities as parameters to read from YAML for an App Implemented the requested feature net-daemon#307 * Started adding xml doc * Started adding xml doc Co-authored-by: Filip STAS <filip@visuasoft.be>
Breaking change
Yes developers using existing generated code will be impacted with a namespace change of their previously generated entities now in NetDaemon.Common.Reactive.Services
Proposed change
The ability to bind to a typed entity using a scalar config in yaml.
e.g. in the app file there is a property like
public LightEntity MyBedroomLight{get;set;}
and in the app's yaml config there is a config
my_bedroom_light: "light.bedroom"
This will create an instance of a LightEntity (as specified by the property's type) for the entity light.bedroom and inject it for the app to use.
This initial version has most of the default entities implemented together with their default services they expose. If a developer would want to he/she could still generate the entities which only will generate the missing services by extending the according entity or create an entire new entity for the unknown entity types.
Code generation has also been updated to support this scenario.
See this example extending the Netdaemon.Generated.Reactive.ScriptEntity while preserving the defaults from NetDaemon.Common.Reactive.Services.ScriptEntity
For this I introduced the RxEntityBase so it did not require me to impact/change the RxEntity implementation, as I do realize they expose a similar CallService method. The new one stays compatible with the code generation and thus does not require a change on that front.
Type of change
Additional information
Checklist
=> Yeah about that, I have a failing test, but the code concerning it was not impacted by my changes as far as I am aware of.
If user exposed functionality or configuration variables are added/changed: