Skip to content

Commit

Permalink
fix: duplicate field names (#16)
Browse files Browse the repository at this point in the history
* also fix vendor name
  • Loading branch information
lhw authored Jul 10, 2024
1 parent 33f7bae commit 0d96969
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions aiocloudweather/station.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
class WeatherstationVendor(Enum):
"""The weather station cloud vendor."""

WUNDERGROUND = "wunderground"
WEATHERCLOUD = "weathercloud"
WUNDERGROUND = "Weather Underground"
WEATHERCLOUD = "Weathercloud.net"


@dataclass
Expand Down Expand Up @@ -292,7 +292,7 @@ def from_wunderground(data: WundergroundRawSensor) -> "WeatherStation":
else f"{sensor_field.name}raw"
)
sensor_data[field_name] = Sensor(
name=sensor_field.name,
name=field_name,
metric=value,
metric_unit=unit,
imperial=value,
Expand Down Expand Up @@ -333,9 +333,9 @@ def from_weathercloud(data: WeathercloudRawSensor) -> "WeatherStation":
conversion_func = METRIC_TO_IMPERIAL.get(unit)

if conversion_func:
value = float(value) / 10 # All values are shifted by 10
value: float = float(value) / 10 # All values are shifted by 10
try:
converted_value = conversion_func(float(value))
converted_value = conversion_func(value)
except TypeError as e:
_LOGGER.error(
"Failed to convert %s from %s to %s: %s -> %s",
Expand Down

0 comments on commit 0d96969

Please sign in to comment.