-
-
Notifications
You must be signed in to change notification settings - Fork 80
Add interfaces #897
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
Merged
Merged
Add interfaces #897
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
2a30ab4
Add interfaces for service targets
PavelVeeamer e95a870
Fix types in Enumerable extension methods
PavelVeeamer d34f8e0
Add testing projects
PavelVeeamer b64ce0e
Add usage of IEnumirable of entities
PavelVeeamer eaed11d
Add part of generated code to the library
PavelVeeamer c7d8371
Add extension method to the library
PavelVeeamer 1dc6634
Add dummy docs
PavelVeeamer 51f446d
Refactored interfaces for entities
PavelVeeamer 2e0aac1
Clean interfaces from redundant function definitions
PavelVeeamer 1840671
Add dynamic resolution of the interfaces name for the entity
PavelVeeamer 5eeef5f
Remove IEntity interface
PavelVeeamer 059ce5b
Refactored
FrankBakkerNl 3ab1ee2
forgotten to add
FrankBakkerNl 39e4533
Fix ctors of NumericEntity
FrankBakkerNl 6256634
Add common domain interfaces
PavelVeeamer 8c21af3
Make extension methods target core interfaces when available, + add s…
FrankBakkerNl da0d483
Add All core interfaces
FrankBakkerNl 1ff3acb
Add dummy HomeAssistantGenerated.cs
FrankBakkerNl File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/HassModel/NetDaemon.HassModel.CodeGenerator/CodeGenerationSettings.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
108 changes: 108 additions & 0 deletions
108
src/HassModel/NetDeamon.HassModel/Entities/Core/CoreInterfaces.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,108 @@ | ||
| namespace NetDaemon.HassModel.Entities; | ||
|
|
||
| // These 'Core' interfaces serve as common types between 3rd party libraries and classes that are generated by the end | ||
| // user using nd-codegen | ||
|
|
||
| /// <summary> Core interface for automation entities </summary> | ||
| public interface IAutomationEntityCore: IEntityCore {} | ||
|
|
||
| /// <summary> Core interface for binary_sensor entities </summary> | ||
| public interface IBinarySensorEntityCore: IEntityCore {} | ||
|
|
||
| /// <summary> Core interface for button entities </summary> | ||
| public interface IButtonEntityCore: IEntityCore {} | ||
|
|
||
| /// <summary> Core interface for calendar entities </summary> | ||
| public interface ICalendarEntityCore: IEntityCore {} | ||
|
|
||
| /// <summary> Core interface for camera entities </summary> | ||
| public interface ICameraEntityCore: IEntityCore {} | ||
|
|
||
| /// <summary> Core interface for climate entities </summary> | ||
| public interface IClimateEntityCore: IEntityCore {} | ||
|
|
||
| /// <summary> Core interface for cover entities </summary> | ||
| public interface ICoverEntityCore: IEntityCore {} | ||
|
|
||
| /// <summary> Core interface for device_tracker entities </summary> | ||
| public interface IDeviceTrackerEntityCore: IEntityCore {} | ||
|
|
||
| /// <summary> Core interface for group entities </summary> | ||
| public interface IGroupEntityCore: IEntityCore {} | ||
|
|
||
| /// <summary> Core interface for input_boolean entities </summary> | ||
| public interface IInputBooleanEntityCore: IEntityCore {} | ||
|
|
||
| /// <summary> Core interface for input_button entities </summary> | ||
| public interface IInputButtonEntityCore: IEntityCore {} | ||
|
|
||
| /// <summary> Core interface for input_datetime entities </summary> | ||
| public interface IInputDatetimeEntityCore: IEntityCore {} | ||
|
|
||
| /// <summary> Core interface for input_number entities </summary> | ||
| public interface IInputNumberEntityCore: IEntityCore {} | ||
|
|
||
| /// <summary> Core interface for input_select entities </summary> | ||
| public interface IInputSelectEntityCore: IEntityCore {} | ||
|
|
||
| /// <summary> Core interface for input_text entities </summary> | ||
| public interface IInputTextEntityCore: IEntityCore {} | ||
|
|
||
| /// <summary> Core interface for light entities </summary> | ||
| public interface ILightEntityCore: IEntityCore {} | ||
|
|
||
| /// <summary> Core interface for lock entities </summary> | ||
| public interface ILockEntityCore: IEntityCore {} | ||
|
|
||
| /// <summary> Core interface for media_player entities </summary> | ||
| public interface IMediaPlayerEntityCore: IEntityCore {} | ||
|
|
||
| /// <summary> Core interface for number entities </summary> | ||
| public interface INumberEntityCore: IEntityCore {} | ||
|
|
||
| /// <summary> Core interface for person entities </summary> | ||
| public interface IPersonEntityCore: IEntityCore {} | ||
|
|
||
| /// <summary> Core interface for proximity entities </summary> | ||
| public interface IProximityEntityCore: IEntityCore {} | ||
|
|
||
| /// <summary> Core interface for remote entities </summary> | ||
| public interface IRemoteEntityCore: IEntityCore {} | ||
|
|
||
| /// <summary> Core interface for scene entities </summary> | ||
| public interface ISceneEntityCore: IEntityCore {} | ||
|
|
||
| /// <summary> Core interface for schedule entities </summary> | ||
| public interface IScheduleEntityCore: IEntityCore {} | ||
|
|
||
| /// <summary> Core interface for script entities </summary> | ||
| public interface IScriptEntityCore: IEntityCore {} | ||
|
|
||
| /// <summary> Core interface for select entities </summary> | ||
| public interface ISelectEntityCore: IEntityCore {} | ||
|
|
||
| /// <summary> Core interface for sensor entities </summary> | ||
| public interface ISensorEntityCore: IEntityCore {} | ||
|
|
||
| /// <summary> Core interface for sun entities </summary> | ||
| public interface ISunEntityCore: IEntityCore {} | ||
|
|
||
| /// <summary> Core interface for switch entities </summary> | ||
| public interface ISwitchEntityCore: IEntityCore {} | ||
|
|
||
| /// <summary> Core interface for timer entities </summary> | ||
| public interface ITimerEntityCore: IEntityCore {} | ||
|
|
||
| /// <summary> Core interface for update entities </summary> | ||
| public interface IUpdateEntityCore: IEntityCore {} | ||
|
|
||
| /// <summary> Core interface for vacuum entities </summary> | ||
| public interface IVacuumEntityCore: IEntityCore {} | ||
|
|
||
| /// <summary> Core interface for weather entities </summary> | ||
| public interface IWeatherEntityCore: IEntityCore {} | ||
|
|
||
| /// <summary> Core interface for zone entities </summary> | ||
| public interface IZoneEntityCore: IEntityCore {} | ||
|
|
||
|
|
17 changes: 17 additions & 0 deletions
17
src/HassModel/NetDeamon.HassModel/Entities/Core/IEntityCore.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| namespace NetDaemon.HassModel.Entities; | ||
|
|
||
| /// <summary> | ||
| /// Core interface for any entity | ||
| /// </summary> | ||
| public interface IEntityCore | ||
| { | ||
| /// <summary> | ||
| /// The IHAContext | ||
| /// </summary> | ||
| public IHaContext HaContext { get; } | ||
|
|
||
| /// <summary> | ||
| /// Entity id being handled by this entity | ||
| /// </summary> | ||
| public string EntityId { get; } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Ther should be one line between functions.