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

Add data to service extensions for services that lacks metadata #1093

Merged
merged 7 commits into from
May 8, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,17 @@ codecover_merged.info
# User-specific files
.idea/
appsettings.Development.json
appsettings.development.json

**/core

**/coverage.json

# remove HA integration test files from git
tests/Integration/HA/config/*
!tests/Integration/HA/config/*.yaml
!tests/Integration/HA/config/*.yaml

# remove codegenerated files
HomeAssistantGenerated.cs
EntityMetaData.json
ServicesMetaData.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,9 @@ private static IEnumerable<MemberDeclarationSyntax> GenerateExtensionMethodsForS
private static MemberDeclarationSyntax ExtensionMethodWithoutArguments(HassService service, string serviceName, string entityTypeName)
{
return ParseMemberDeclaration($$"""
public static void {{GetServiceMethodName(serviceName)}}(this {{entityTypeName}} target)
public static void {{GetServiceMethodName(serviceName)}}(this {{entityTypeName}} target, object? data = null)
{
target.CallService("{{serviceName}}");
target.CallService("{{serviceName}}", data);
}
""")!
.WithSummaryComment(service.Description);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ private static SyntaxTrivia[] GetFileHeader()
// In the template projects we provided a convenience powershell script that will update
// the codegen and nugets to latest versions update_all_dependencies.ps1.
//
// For more information: https://netdaemon.xyz/docs/v3/hass_model/hass_model_codegen
// For more information: https://netdaemon.xyz/docs/user/hass_model/hass_model_codegen
// For more information about NetDaemon: https://netdaemon.xyz/
// </auto-generated>
//------------------------------------------------------------------------------";
Expand Down
Loading