Skip to content

Commit

Permalink
Added rain storm info
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcoGos committed Feb 9, 2024
1 parent 6c6cad7 commit e311700
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 6 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,10 @@ The following entities will be created:
- 10 minutes average wind speed
- Wind Speed (Bft):
- 10 minutes average wind speed in Beaufort
- Rain Storm:
- Total rainfall during an extended period of rain
- Storm Start Date:
- Start date or current rain storm
- Extra Humidity 1-7:
- Current humidity extra sensor 1-7
- Extra Temperature 1-7:
Expand Down
1 change: 0 additions & 1 deletion custom_components/davis_vantage/binary_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.helpers.update_coordinator import CoordinatorEntity
from homeassistant.helpers.entity import EntityCategory

from .const import DEFAULT_NAME, DOMAIN
from .coordinator import DavisVantageDataUpdateCoordinator
Expand Down
2 changes: 2 additions & 0 deletions custom_components/davis_vantage/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,8 @@ def correct_rain_values(self, data: dict[str, Any]):
data["RainYear"] *= 2 / 2.54
if data["RainRate"] is not None:
data["RainRate"] *= 2 / 2.54
if data["RainStorm"] is not None:
data["RainStorm"] *= 2 / 2.54
if "RainRateDay" in data:
if data["RainRateDay"] is not None:
data["RainRateDay"] *= 2 / 2.54
Expand Down
2 changes: 1 addition & 1 deletion custom_components/davis_vantage/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
DOMAIN = "davis_vantage"
MANUFACTURER = "Davis"
MODEL = "Vantage Pro2/Vue"
VERSION = "1.1.5"
VERSION = "1.1.6"

DEFAULT_SYNC_INTERVAL = 30 # seconds
DEFAULT_NAME = NAME
Expand Down
2 changes: 1 addition & 1 deletion custom_components/davis_vantage/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"integration_type": "hub",
"iot_class": "local_polling",
"issue_tracker": "https://github.com/MarcoGos/davis_vantage/issues",
"requirements": ["PyVantagePro-MarcoGos==0.3.11"],
"requirements": ["PyVantagePro-MarcoGos==0.3.13"],
"ssdp": [],
"version": "1.0.0",
"zeroconf": []
Expand Down
20 changes: 17 additions & 3 deletions custom_components/davis_vantage/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@

from .const import (
DEFAULT_NAME,
DOMAIN,
CONFIG_STATION_MODEL,
MODEL_VANTAGE_PRO2PLUS
DOMAIN
)

from .coordinator import DavisVantageDataUpdateCoordinator
Expand Down Expand Up @@ -422,6 +420,22 @@
entity_category=EntityCategory.DIAGNOSTIC,
entity_registry_enabled_default=False
),
SensorEntityDescription(
key="RainStorm",
name="Rain Storm",
icon="mdi:water-outline",
device_class=SensorDeviceClass.PRECIPITATION,
state_class="measurement",
native_unit_of_measurement=UnitOfLength.INCHES,
suggested_display_precision=1,
entity_registry_enabled_default=False
),
SensorEntityDescription(
key="StormStartDate",
name="Rain Storm Start Date",
icon="mdi:calendar-outline",
entity_registry_enabled_default=False
),
SensorEntityDescription(
key="ExtraTemps01",
name="Extra Temperature 1",
Expand Down

0 comments on commit e311700

Please sign in to comment.