You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My home-assistant installation has some switches with entity ids like "switch.25388007840d8e5f2760_1" This causes an exception in CodeGenerator:GenerateCode() as it tries to create a property declaration like
public IEntity 25388007840d8e5f27602 => _app.Entity(\"switch.25388007840d8e5f2760_2\");
and that is not a valid C# identifier. There is some code that attempts to detect this with long.TryParse(name, out _) but that is not sufficient to handle all invalid c# identifiers.
Environment
NetDaemon release with the issue: 0.5.1
Last working NetDaemon release (if known):
Operating environment (Home assistant Add-on/Docker/Dev setup): docker and dev
The problem
My home-assistant installation has some switches with entity ids like "switch.25388007840d8e5f2760_1" This causes an exception in CodeGenerator:GenerateCode() as it tries to create a property declaration like
and that is not a valid C# identifier. There is some code that attempts to detect this with
long.TryParse(name, out _)
but that is not sufficient to handle all invalid c# identifiers.Environment
Link to or paste code that causes the issue
Traceback/Error logs
Additional information
The text was updated successfully, but these errors were encountered: