Commit Graph

41 Commits (a9381d259040d4a02881cc9e203bc8e3946b2146)

Author SHA1 Message Date
Kevin Stillhammer 173f4760bc
Deprecate weather.get_forecast (#102534)
* Deprecate weather.get_forecast

* Rename forecast to get_forecasts

* raise issue for use of deprecated service

* Add fix_flow

* Add service translation/yaml
2023-11-19 20:44:02 +01:00
Erik Montnemery 68e2809c36
Modernize nws weather (#98748) 2023-08-22 10:01:17 +02:00
lymanepp 6c4b5291e1
Add humidity to NWS forecast (#95575)
* Add humidity to NWS forecast to address https://github.com/home-assistant/core/issues/95572

* Use pynws 1.5.0 enhancements for probabilityOfPrecipitation, dewpoint, and relativeHumidity.

* Update requirements to match pynws version

* test for clear night

* update docstring

---------

Co-authored-by: MatthewFlamm <39341281+MatthewFlamm@users.noreply.github.com>
2023-07-06 23:05:46 +02:00
MatthewFlamm d0460d5424
Fix NWS error with no observation (#92997)
Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
2023-05-17 22:00:13 +02:00
Paulus Schoutsen d6a223f0e1
Await block till done inside patched config entry in tests (#89515) 2023-03-10 06:42:53 -10:00
Franck Nijhof ed79265843
Enable Ruff PT006 (#88165)
* Enable Ruff PT006

* Adjust existing cases

* Fix tests

* Remove unneeded parentheses
2023-02-15 14:09:50 +01:00
epenet 88444b2e0c
Add type hints to integration tests (part 16) (#88008) 2023-02-15 10:50:02 +01:00
Franck Nijhof 62dcbe5258
Enable Ruff PT001 (#86730) 2023-01-26 18:05:05 +01:00
Michael d8c3b87d44
Replace deprecated constants and utils by their successors in NWS tests (#85926) 2023-01-16 20:02:26 +01:00
Sean Chen 985c1b31e1
Use new device class in nws (#83172)
* Replace unit consts with enums

* Remove default entries in NWSSensorEntityDescription

* Replace wind icon property with setting device_class in Wind Speed and Wind Gust sensors
2022-12-06 13:27:58 +01:00
epenet e84e5f134e
Use US_CUSTOMARY_SYSTEM in tests (#80658)
* Use US_CUSTOMARY_SYSTEM in tests

* Don't update test_unit_system
2022-10-20 15:42:23 +02:00
epenet 00dd27ef1b
Apply hass-relative-import to tests (i-r) (#78732) 2022-09-19 09:46:59 +02:00
MatthewFlamm e32c7dbf92
Use built in unit handling for nws weather (#73981)
use built in unit handling for nws
2022-06-27 11:39:02 +02:00
Franck Nijhof 69cc6ab5f1
Clean up accessing entity_registry.async_get_registry helper via hass (#72005) 2022-05-17 16:40:45 +02:00
rianadon c4a2204cc7
Calculate temperature precision based on user units (#59560)
* Calculate temperature precision based on user units

* Fix a few more failing tests

* Fix failing test

Co-authored-by: Erik <erik@montnemery.com>
2022-03-30 22:49:28 +02:00
rianadon a102c425a9
Add speed conversion function & add speed to units system (#53846)
* Add speed conversion function

* Add test for speed utility functions

* Update unit system tests

* Fix incorrect unit conversions in tests

* Fix some test errors

* Calculate speed units from smaller set of constants

* Fix typo in speed test

* Use pytest.approx for checking floating point values

* Change other instance of speeds needing to be pytest.approx

* Revert changes to unit system

* Fix oopsie in defining in/day and in/hr

* Parametrize test

* Add comments describing calculations & remove duplicate test
2021-11-09 08:12:28 +01:00
Paulus Schoutsen a4d9019ffc
Refactor persistent notification to no longer route all data via a service (#57157)
* Convert persistent notification tests to async

* Create/dismiss persistent notifications in exposed functions, not service calls

* Fix notify persistent_notification

* Remove setting up persistent_notification

* Drop more setups

* Empty methods

* Undeprecate sync methods because too big task

* Fix setup clearing notifications

* Fix a bunch of tests

* Fix more tests

* Uno mas

* Test persistent notification events

* Clean up stale comment

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-10-07 12:58:00 +02:00
Marc Mueller 3e08e50050
Use EntityDescription - nws (#53523)
* Use EntityDescription - nws

* Bugfix

* Bugfix 2
2021-07-27 01:46:01 +02:00
Marc Mueller d98e580c3c
Use NamedTuple - nws (#53293) 2021-07-21 22:24:07 -07:00
Franck Nijhof af80ca6795
Clean up superfluous integration setup - part 5 (#49296) 2021-04-16 09:22:56 -07:00
MatthewFlamm f8f0495319
Add nws sensor platform (#45027)
* Resolve rebase conflict.

Remove logging

* lint: fix elif after return

* fix attribution

* add tests for None valuea

* Remove Entity import

Co-authored-by: Erik Montnemery <erik@montnemery.com>

* Import SensorEntity

Co-authored-by: Erik Montnemery <erik@montnemery.com>

* Inherit SensorEntity

Co-authored-by: Erik Montnemery <erik@montnemery.com>

* remove unused logging

* Use CoordinatorEntity

* Use type instead of name.

* add all entities

* add nice rounding to temperature and humidity

Co-authored-by: Erik Montnemery <erik@montnemery.com>
2021-04-01 18:50:37 +02:00
Erik Montnemery 84226da404
Update tests i-o to use async_get() instead of async_get_registry() (#47653) 2021-03-09 14:32:08 +01:00
Paulus Schoutsen 9e07910ab0
Mark entities as unavailable when they are removed but are still registered (#45528)
* Mark entities as unavailable when they are removed but are still registered

* Add sync_entity_lifecycle to collection helper

* Remove debug print

* Lint

* Fix tests

* Fix tests

* Update zha

* Update zone

* Fix tests

* Update hyperion

* Update rfxtrx

* Fix tests

* Pass force_remove=True from integrations

Co-authored-by: Erik <erik@montnemery.com>
2021-02-08 10:45:46 +01:00
Franck Nijhof 65cf2fcb6f
Drop asynctest (#44746) 2021-01-01 22:31:56 +01:00
Paulus Schoutsen 1c36bf5e19
Fix block till done in create entry config flow tests (#42290) 2020-10-24 16:20:56 +02:00
MatthewFlamm ab3909c24f
Disable hourly sensor by default in NWS (#40566) 2020-09-30 16:53:33 +02:00
MatthewFlamm 958c9c08d6
Use more homeassistant constants in NWS (#39690) 2020-09-05 21:11:15 +02:00
Franck Nijhof 1c2ebdf307
Upgrade black to 20.8b1 (#39287) 2020-08-27 13:56:20 +02:00
MatthewFlamm 11debb1568
Fix wind speed change in NWS (#37222) 2020-06-29 15:41:52 -07:00
MatthewFlamm 3a97d96dc0
Cache data and update faster after failed updates in NWS (#35722)
* add last_update_success_time  and a failed update interval

* add failed update interval annd valid times to nws

* Revert "add last_update_success_time  and a failed update interval"

This reverts commit 09428c9686.

* extend DataUpdateCoordinator
2020-05-25 18:39:46 -05:00
MatthewFlamm 7ac547a6e0
Enable async_update for entities in NWS (#35048)
* enable async_update for entities

* make platinum

* add manual update test
2020-05-07 22:43:43 -05:00
Paulus Schoutsen 2af984917e
Use asynctest-mock in most places (#35109)
* Use asynctest-mock in most places

* Fix broken patch in pilight
2020-05-03 11:27:19 -07:00
Paulus Schoutsen ec47216388
Use built-in test helpers on 3.8 (#34901) 2020-04-30 13:29:50 -07:00
MatthewFlamm 64cd38d96f
Use DataUpdateCoordinator in NWS (#34372) 2020-04-18 08:59:20 -05:00
MatthewFlamm 6d812bd957
Add config flow to nws and remove yaml configuration (#34267)
* add config flow to nws and remove yaml

* Don't duplicate scan_time

Co-Authored-By: J. Nick Koston <nick@koston.org>

* Use _abort_if_unique_id_configured

Co-Authored-By: J. Nick Koston <nick@koston.org>

* fix abort

* Add unavailable tests

* update and use better strings

* lint

Co-authored-by: J. Nick Koston <nick@koston.org>
2020-04-16 09:15:55 -05:00
MatthewFlamm e6a6c3ceb6
Fix nws platform setup and data update. (#34106)
* add test and fix tests for update logging.

* Fix update logging.

* Remove assert is True

* guard against platform config and use async_write_ha_state

* fix discovery info passing to platform

* Improve testing for entities in init
2020-04-12 17:19:22 -05:00
MatthewFlamm a3e84791c6
Convert nws integration to component configuration (#31398)
* convert nws to component configuration

* add more debug logging

* remove assumed state

* move initialization of data into init

* refactor update logic

* use forecast success for checking available entities

* Split unique_id into more usable pieces.

use a base_unique_id for each entry.  Add domain for signaling to entities.  Each entity in each platform can use base_unique_id to form individual unique_id's.

* Revert "move initialization of data into init"

This reverts commit 09eb0220469285b10f0500f5f6def67415931a81.

* add silver quality scale to manifest

* unsubscribe listener in will_remove_from_hass

* initialize _unsub_listener in __init__

* use async_on_remove

* remove scan interval from configuration

* Use better name

Co-Authored-By: J. Nick Koston <nick@koston.org>

Co-authored-by: J. Nick Koston <nick@koston.org>
2020-04-08 10:22:25 -05:00
MatthewFlamm b8feaba5cb Update pynws to v0.10.1 (#30662)
* update to pynws 0.10.1

* remove unneeded raw json files

* move test helper module to const
2020-01-15 12:01:47 -08:00
Bas Nijholt 1ab1808307 Sort imports according to PEP8 for components starting with "N" (#29773) 2019-12-09 14:46:24 +01:00
MatthewFlamm 0e15785602 Bump pynws version to 0.8.1 (#26770)
* Bump to version 0.8.1

Fixes #26753.

* gen_requirements.py changes

* fix default params change in tests
2019-09-21 15:56:40 +02:00
MatthewFlamm 17750a604e Add NWS weather (#23647)
* Add nws weather.

* Hassfest

* Address multiple comments

* Add NWS icon weather code link

* Add metar fallback.

Use metar code from nws observation if normal api is missing data.

* only get 1 observation - we dont use more than 1

* add mocked metar for tests

* lint

* mock metar package for all tests

* add check for metar attributes

* catch errors in setup

* add timeout error

* handle request exceptions

* check and test for missing observations

* refactor to new pynws

* change to simpler api

* Make py3.5 compatible

Remove f string

* bump pynws version

* gen_requirements

* fix wind bearing observation

* Revert "Make py3.5 compatible"

This reverts commit 4946d91779.

* Precommit black missed a file?

* black test

* add exceptional weather condition

* bump pynws version

* update requirements_all

* address comments

* move observation and forecast outside try-except-else

* Revert "move observation and forecast outside try-except-else"

This reverts commit 53b78b3283.

* remove else from update forecast block

* remove unneeded ConfigEntryNotReady import

* add scan_interval, reduce min_time_between_updates

* pytest tests

* lint test docstring

* use async await

* lat and lon inclusive in config
2019-08-23 14:13:06 +02:00