Skip to content

Commit

Permalink
Merge pull request #196 from astrandb/FixNegativeGust
Browse files Browse the repository at this point in the history
Change negative gust values to 0.0
  • Loading branch information
astrandb authored Oct 10, 2024
2 parents 78700ef + dfe179c commit 02675e8
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 4 deletions.
2 changes: 1 addition & 1 deletion custom_components/weatherlink/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from enum import StrEnum

DOMAIN = "weatherlink"
VERSION = "2024.4.0b0"
VERSION = "2024.10.0b0"

MANUFACTURER = "Davis Instruments"
CONFIG_URL = "https://www.weatherlink.com/"
Expand Down
2 changes: 1 addition & 1 deletion custom_components/weatherlink/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@
"issue_tracker": "https://github.com/astrandb/weatherlink/issues",
"requirements": [],
"ssdp": [],
"version": "2024.4.0b0",
"version": "2024.10.0b0",
"zeroconf": []
}
17 changes: 16 additions & 1 deletion custom_components/weatherlink/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -784,7 +784,22 @@ def generate_model(self):
def native_value(self):
"""Return the state of the sensor."""
# _LOGGER.debug("Key: %s", self.entity_description.key)
if self.entity_description.key not in ["WindDir", "BarTrend"]:
if self.entity_description.key not in ["WindDir", "BarTrend", "WindGust"]:
return self.coordinator.data[self.tx_id].get(self.entity_description.tag)

if self.entity_description.tag in [DataKey.WIND_GUST_MPH]:
if (
self.coordinator.data[self.tx_id].get(self.entity_description.tag)
is None
):
return None
if (
float(
self.coordinator.data[self.tx_id].get(self.entity_description.tag)
)
< 0
):
return 0.0
return self.coordinator.data[self.tx_id].get(self.entity_description.tag)

if self.entity_description.tag in [DataKey.WIND_DIR]:
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpver]
current_version = 2024.4.0b0
current_version = 2024.10.0b0
version_pattern = YYYY.MM.PATCH[PYTAGNUM]
commit_message = "Bump version from {old_version} to {new_version}"
commit = False
Expand Down

0 comments on commit 02675e8

Please sign in to comment.