mirror of
https://github.com/home-assistant/core.git
synced 2026-02-27 13:25:35 +00:00
Use native_visibility property instead of visibility for OpenWeatherMap weather entity (#151867)
This commit is contained in:
@@ -181,7 +181,7 @@ class OpenWeatherMapWeather(SingleCoordinatorWeatherEntity[OWMUpdateCoordinator]
|
||||
return self.coordinator.data[ATTR_API_CURRENT].get(ATTR_API_WIND_BEARING)
|
||||
|
||||
@property
|
||||
def visibility(self) -> float | str | None:
|
||||
def native_visibility(self) -> float | None:
|
||||
"""Return visibility."""
|
||||
return self.coordinator.data[ATTR_API_CURRENT].get(ATTR_API_VISIBILITY_DISTANCE)
|
||||
|
||||
|
||||
@@ -72,6 +72,7 @@
|
||||
'pressure_unit': <UnitOfPressure.HPA: 'hPa'>,
|
||||
'temperature': 6.8,
|
||||
'temperature_unit': <UnitOfTemperature.CELSIUS: '°C'>,
|
||||
'visibility': 10.0,
|
||||
'visibility_unit': <UnitOfLength.KILOMETERS: 'km'>,
|
||||
'wind_bearing': 199,
|
||||
'wind_gust_speed': 42.52,
|
||||
@@ -136,6 +137,7 @@
|
||||
'supported_features': <WeatherEntityFeature: 2>,
|
||||
'temperature': 6.8,
|
||||
'temperature_unit': <UnitOfTemperature.CELSIUS: '°C'>,
|
||||
'visibility': 10.0,
|
||||
'visibility_unit': <UnitOfLength.KILOMETERS: 'km'>,
|
||||
'wind_bearing': 199,
|
||||
'wind_gust_speed': 42.52,
|
||||
@@ -200,6 +202,7 @@
|
||||
'supported_features': <WeatherEntityFeature: 3>,
|
||||
'temperature': 6.8,
|
||||
'temperature_unit': <UnitOfTemperature.CELSIUS: '°C'>,
|
||||
'visibility': 10.0,
|
||||
'visibility_unit': <UnitOfLength.KILOMETERS: 'km'>,
|
||||
'wind_bearing': 199,
|
||||
'wind_gust_speed': 42.52,
|
||||
|
||||
Reference in New Issue
Block a user