mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 21:06:19 +00:00
Use metric units internally in Accuweather integration (#90444)
* Use metric units internally * Remove unnecessary code * Simplify sensor classes * Remove AccuWeatherForecastSensor class * Update wind speed value in test * Return suggested_unit_of_measurement for wind entities * Clean test * Use _attr_suggested_unit_of_measurement * Remove _get_suggested_unit() * Remove unnecessarey code
This commit is contained in:
@@ -741,11 +741,21 @@ async def test_sensor_imperial_units(hass: HomeAssistant) -> None:
|
||||
|
||||
state = hass.states.get("sensor.home_cloud_ceiling")
|
||||
assert state
|
||||
assert state.state == "10500.0"
|
||||
assert state.attributes.get(ATTR_ATTRIBUTION) == ATTRIBUTION
|
||||
assert state.attributes.get(ATTR_ICON) == "mdi:weather-fog"
|
||||
assert state.state == "10498.687664042"
|
||||
assert state.attributes.get(ATTR_UNIT_OF_MEASUREMENT) == UnitOfLength.FEET
|
||||
|
||||
state = hass.states.get("sensor.home_wind")
|
||||
assert state
|
||||
assert state.state == "9.0"
|
||||
assert state.attributes.get(ATTR_UNIT_OF_MEASUREMENT) == UnitOfSpeed.MILES_PER_HOUR
|
||||
|
||||
state = hass.states.get("sensor.home_realfeel_temperature")
|
||||
assert state
|
||||
assert state.state == "77.2"
|
||||
assert (
|
||||
state.attributes.get(ATTR_UNIT_OF_MEASUREMENT) == UnitOfTemperature.FAHRENHEIT
|
||||
)
|
||||
|
||||
|
||||
async def test_state_update(hass: HomeAssistant) -> None:
|
||||
"""Ensure the sensor state changes after updating the data."""
|
||||
|
||||
Reference in New Issue
Block a user