Skip to content

Commit

Permalink
Fix #715, ProximityEntity with numeric state (#822)
Browse files Browse the repository at this point in the history
Co-authored-by: Tomas Hellström <[email protected]>
  • Loading branch information
FrankBakkerNl and helto4real authored Dec 29, 2022
1 parent 144b0ce commit c4c570f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

internal static class EntityIdHelper
{
public static readonly string[] NumericDomains = { "input_number", "number" };
public static readonly string[] NumericDomains = { "input_number", "number", "proximity" };
public static readonly string[] MixedDomains = { "sensor" };

public static string GetDomain(string str)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ public void TestNumericSensorEntityGeneration()
new()
{
EntityId = "sensor.Pir",
},
new()
{
EntityId = "proximity.home",
},
};

Expand All @@ -106,6 +110,9 @@ public void Run(IHaContext ha)

SensorEntity pirSensor = entities.Sensor.Pir;
string? pir = pirSensor.State;

ProximityEntity homeProximity = entities.Proximity.Home;
double? distance = homeProximity.State;
}
}
""";
Expand Down

0 comments on commit c4c570f

Please sign in to comment.