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

V3 api, more flexible formulas, persist storage #14

Open
wants to merge 22 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
b887ec9
run isort and black for formatting
tsbernar Apr 14, 2023
b63e6f6
Add type hints to sensor
tsbernar Apr 14, 2023
2bd7250
handle non-200 response code, log unexpected
tsbernar Apr 16, 2023
341b617
Add support for v3 api.
tsbernar Apr 20, 2023
3a33e92
*Implement new sensor type, `total_rain`.
tsbernar Apr 22, 2023
68d50d4
fix json load on v2.5
tsbernar Apr 22, 2023
94b9ffc
run backfill in background task, fix timezone in tests
tsbernar Apr 23, 2023
3522143
typehint
tsbernar Apr 23, 2023
2744956
formatting
tsbernar Apr 23, 2023
d44c33b
bug fix
tsbernar Apr 23, 2023
0457147
Clean up persistent storage logic and fix bugs
tsbernar Apr 23, 2023
d335874
fix total aggregation to work with arbitrary timestamps, add test
tsbernar Apr 23, 2023
a65e57d
-Lower default API limits to support:
tsbernar Apr 24, 2023
9c73b6e
BREAKING CONFIG CHANGE: "v3_api" no longer supported as config option.
tsbernar Apr 24, 2023
5284bd4
Don't write data if no change
tsbernar Apr 24, 2023
06ee1b7
Use assignment instead of .clear() on the deque to play nicely with o…
tsbernar Apr 24, 2023
89c29fe
-Add config flow for UI setup
tsbernar May 7, 2023
eda9c96
add unique_id for sensors, fix test, add maxlen to new deques
tsbernar May 7, 2023
cbb6448
check units before setting default watertarget
tsbernar May 7, 2023
3f95bec
Add default location name from HA config
tsbernar May 7, 2023
476cecf
use native units for backfill pct
tsbernar May 9, 2023
811187f
Use current config as defaults for lookback days and limits
tsbernar May 9, 2023
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
26 changes: 25 additions & 1 deletion custom_components/openweathermaphistory/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,25 @@
#
"""The openweathermaphistory integration."""

from homeassistant.config_entries import ConfigEntry
from homeassistant.const import Platform
from homeassistant.core import HomeAssistant


async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
"""Set up from a config entry (from UI config)"""
entry.async_on_unload(entry.add_update_listener(update_listener))
await hass.config_entries.async_forward_entry_setups(entry, [Platform.SENSOR])
return True


async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
"""Unload a config entry."""
unload_ok = await hass.config_entries.async_unload_platforms(
entry, [Platform.SENSOR]
)
return unload_ok


async def update_listener(hass: HomeAssistant, entry: ConfigEntry) -> None:
"""Handle options flow update (from UI reconfigure)."""
await hass.config_entries.async_reload(entry.entry_id)
Loading