Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add additional weathercloud fields #27

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions aiocloudweather/station.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,17 @@ class WeathercloudRawSensor:
temperature: int = field(
default=None, metadata={"unit": UnitOfTemperature.CELSIUS, "arg": "temp"}
)
temperature2: int = field(
default=None, metadata={"unit": UnitOfTemperature.CELSIUS, "arg": "temp02"}
)
temperatureindoor: int = field(
default=None, metadata={"unit": UnitOfTemperature.CELSIUS, "arg": "tempin"}
)
humidity: int = field(default=None, metadata={"unit": PERCENTAGE, "arg": "hum"})
humidity2: int = field(default=None, metadata={"unit": PERCENTAGE, "arg": "hum02"})
humidityindoor: int = field(
default=None, metadata={"unit": PERCENTAGE, "arg": "humin"}
)
indoortemperature: int = field(
default=None, metadata={"unit": UnitOfTemperature.CELSIUS, "arg": "tempin"}
)
Expand All @@ -133,6 +143,9 @@ class WeathercloudRawSensor:
dewpoint: int = field(
default=None, metadata={"unit": UnitOfTemperature.CELSIUS, "arg": "dew"}
)
dewpointindoor: int = field(
default=None, metadata={"unit": UnitOfTemperature.CELSIUS, "arg": "dewin"}
)
heatindex: int = field(
default=None, metadata={"unit": UnitOfTemperature.CELSIUS, "arg": "heat"}
)
Expand All @@ -147,6 +160,15 @@ class WeathercloudRawSensor:
"arg": "rainrate",
},
)
heatindex: int = field(
default=None, metadata={"unit": UnitOfTemperature.CELSIUS, "arg": "heat"}
)
heatindexindoor: int = field(
default=None, metadata={"unit": UnitOfTemperature.CELSIUS, "arg": "heatin"}
)
temphumiditywind: int = field(
default=None, metadata={"unit": UnitOfTemperature.CELSIUS, "arg": "thw"}
)
winddirection: int = field(default=None, metadata={"unit": DEGREE, "arg": "wdir"})
windspeed: int = field(
default=None, metadata={"unit": UnitOfSpeed.METERS_PER_SECOND, "arg": "wspd"}
Expand All @@ -157,6 +179,9 @@ class WeathercloudRawSensor:
windchill: int = field(
default=None, metadata={"unit": UnitOfTemperature.CELSIUS, "arg": "chill"}
)
windspeedavg: int = field(
default=None, metadata={"unit": UnitOfSpeed.METERS_PER_SECOND, "arg": "wspdavg"}
)
uv: int = field(default=None, metadata={"unit": UV_INDEX, "arg": "uvi"})
solarradiation: int = field(
default=None,
Expand All @@ -166,6 +191,7 @@ class WeathercloudRawSensor:
"arg": "solarrad",
},
)
visibility: int = field(default=None, metadata={"unit": "km", "arg": "vis"})


IMPERIAL_TO_METRIC: Final = {
Expand Down Expand Up @@ -215,12 +241,25 @@ class WeatherStation:

barometer: Sensor = field(default=None, metadata={"name": "Absolute Pressure"})
temperature: Sensor = field(default=None, metadata={"name": "Outdoor Temperature"})
temperature2: Sensor = field(
default=None, metadata={"name": "Outdoor Temperature #2"}
)
temphumiditywind: Sensor = field(
default=None,
metadata={"name": "Temperature-Humidity-Wind Index or 'feels like'"},
)
temperatureindoor: Sensor = field(
default=None, metadata={"name": "Indoor Temperature"}
)
humidity: Sensor = field(default=None, metadata={"name": "Outdoor Humidity"})
humidity2: Sensor = field(default=None, metadata={"name": "Outdoor Humidity #2"})
humidityindoor: Sensor = field(default=None, metadata={"name": "Indoor Humidity"})
indoortemperature: Sensor = field(
default=None, metadata={"name": "Indoor Temperature"}
)
indoorhumidity: Sensor = field(default=None, metadata={"name": "Indoor Humidity"})
dewpoint: Sensor = field(default=None, metadata={"name": "Outdoor Dewpoint"})
dewpointindoor: Sensor = field(default=None, metadata={"name": "Indoor Dewpoint"})
rain: Sensor = field(default=None, metadata={"name": "Rain Rate"})
dailyrain: Sensor = field(default=None, metadata={"name": "Daily Rain Rate"})
winddirection: Sensor = field(default=None, metadata={"name": "Wind Direction"})
Expand All @@ -229,13 +268,17 @@ class WeatherStation:
windgustdirection: Sensor = field(
default=None, metadata={"name": "Wind Gust Direction"}
)
windspeedavg: Sensor = field(default=None, metadata={"name": "Wind Speed Average"})
windchill: Sensor = field(default=None, metadata={"name": "Wind Chill"})
uv: Sensor = field(default=None, metadata={"name": "UV Index"})
solarradiation: Sensor = field(default=None, metadata={"name": "Solar Radiation"})
solarradiationraw: Sensor = field(
default=None, metadata={"name": "Solar Radiation Raw"}
)
heatindex: Sensor = field(default=None, metadata={"name": "Heat Index"})
heatindexindoor: Sensor = field(
default=None, metadata={"name": "Indoor Heat Index"}
)

@staticmethod
def from_wunderground(data: WundergroundRawSensor) -> "WeatherStation":
Expand Down
Loading