diff --git a/resources/tests/config/configuration.yaml b/resources/tests/config/configuration.yaml index ce42399..44fd108 100644 --- a/resources/tests/config/configuration.yaml +++ b/resources/tests/config/configuration.yaml @@ -1,4 +1,9 @@ default_config: +homeassistant: + country: ES + latitude: 37.3886303 + longitude: -5.9953403 + elevation: 17 group: !include groups.yaml automation: !include automations.yaml diff --git a/src/HassClient.Core/Models/ConfigurationModel.cs b/src/HassClient.Core/Models/ConfigurationModel.cs index d65b879..1cca6d3 100644 --- a/src/HassClient.Core/Models/ConfigurationModel.cs +++ b/src/HassClient.Core/Models/ConfigurationModel.cs @@ -125,8 +125,21 @@ private string[] allowlist_external_dirs /// /// Gets the currency code according to ISO 4217 (column "Code" from ). /// + [JsonProperty] public string Currency { get; private set; } + /// + /// Gets the country code according to ISO 3166.1 alpha-2 (column "Code" from ). + /// + [JsonProperty] + public string Country { get; private set; } + + /// + /// Gets the language code according to RFC 5646 language tag (column "639-1" from ). + /// + [JsonProperty] + public string Language { get; private set; } + /// public override string ToString() => this.LocationName; } diff --git a/src/HassClient.WS.Tests/ConfigurationApiTests.cs b/src/HassClient.WS.Tests/ConfigurationApiTests.cs index cb8c46e..f23801b 100644 --- a/src/HassClient.WS.Tests/ConfigurationApiTests.cs +++ b/src/HassClient.WS.Tests/ConfigurationApiTests.cs @@ -61,6 +61,7 @@ public void ConfigurationHasLocation() Assert.NotNull(this.configuration.LocationName); Assert.NotZero(this.configuration.Latitude); Assert.NotZero(this.configuration.Longitude); + Assert.NotZero(this.configuration.Elevation); } [Test] @@ -91,5 +92,23 @@ public void ConfigurationHasVersion() { Assert.NotNull(this.configuration.Version); } + + [Test] + public void ConfigurationHasCurrency() + { + Assert.NotNull(this.configuration.Currency); + } + + [Test] + public void ConfigurationHasLanguage() + { + Assert.NotNull(this.configuration.Language); + } + + [Test] + public void ConfigurationHasCountry() + { + Assert.NotNull(this.configuration.Country); + } } }