Skip to content

Commit e438b11

Browse files
authored
Use native_visibility property instead of visibility for OpenWeatherMap weather entity (home-assistant#151867)
1 parent 64ba437 commit e438b11

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

homeassistant/components/openweathermap/weather.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ def wind_bearing(self) -> float | str | None:
181181
return self.coordinator.data[ATTR_API_CURRENT].get(ATTR_API_WIND_BEARING)
182182

183183
@property
184-
def visibility(self) -> float | str | None:
184+
def native_visibility(self) -> float | None:
185185
"""Return visibility."""
186186
return self.coordinator.data[ATTR_API_CURRENT].get(ATTR_API_VISIBILITY_DISTANCE)
187187

tests/components/openweathermap/snapshots/test_weather.ambr

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@
7272
'pressure_unit': <UnitOfPressure.HPA: 'hPa'>,
7373
'temperature': 6.8,
7474
'temperature_unit': <UnitOfTemperature.CELSIUS: '°C'>,
75+
'visibility': 10.0,
7576
'visibility_unit': <UnitOfLength.KILOMETERS: 'km'>,
7677
'wind_bearing': 199,
7778
'wind_gust_speed': 42.52,
@@ -136,6 +137,7 @@
136137
'supported_features': <WeatherEntityFeature: 2>,
137138
'temperature': 6.8,
138139
'temperature_unit': <UnitOfTemperature.CELSIUS: '°C'>,
140+
'visibility': 10.0,
139141
'visibility_unit': <UnitOfLength.KILOMETERS: 'km'>,
140142
'wind_bearing': 199,
141143
'wind_gust_speed': 42.52,
@@ -200,6 +202,7 @@
200202
'supported_features': <WeatherEntityFeature: 3>,
201203
'temperature': 6.8,
202204
'temperature_unit': <UnitOfTemperature.CELSIUS: '°C'>,
205+
'visibility': 10.0,
203206
'visibility_unit': <UnitOfLength.KILOMETERS: 'km'>,
204207
'wind_bearing': 199,
205208
'wind_gust_speed': 42.52,

0 commit comments

Comments
 (0)