Commit Graph

42 Commits (7cd4f787678b76bd0bc6c360321ed45a655dd2b5)

Author SHA1 Message Date
Marc Mueller f11b316dac
Import Generator from collections.abc (4) (#120917) 2024-07-01 11:54:42 +02:00
epenet ecad1bef7e
Avoid cross-domain imports in scrape tests (#119351) 2024-06-11 07:57:45 +02:00
Marc Mueller 837ee7c4fb
Import Generator from typing_extensions (4) (#118992) 2024-06-06 17:41:37 +02:00
epenet e58d060f82
Use registry fixtures in tests (s) (#118295) 2024-05-28 15:41:03 +02:00
epenet a3942e019b
Use remove_device helper in tests (2/2) (#116442)
Use remove_device helper in tests (part 2)
2024-04-30 12:50:35 +02:00
epenet 9204ccfa17
Use is in ConfigEntryState enum comparison in tests (N-Z) (#114926) 2024-04-05 17:37:00 +02:00
Joost Lekkerkerker ee66f6ec8c
Use is in enum comparison in config flow tests P-T (#114675) 2024-04-02 11:21:50 -10:00
J. Nick Koston 9a79320861
Mark executor jobs as background unless created from a tracked task (#114450)
* Mark executor jobs as background unless created from a tracked task

If the current task is not tracked the executor job should not
be a background task to avoid delaying startup and shutdown.

Currently any executor job created in a untracked task or
background task would end up being tracked and delaying
startup/shutdown

* import exec has the same issue

* Avoid tracking import executor jobs

There is no reason to track these jobs as they are always awaited
and we do not want to support fire and forget import executor jobs

* fix xiaomi_miio

* lots of fire time changed without background await

* revert changes moved to other PR

* more

* more

* more

* m

* m

* p

* fix fire and forget tests

* scrape

* sonos

* system

* more

* capture callback before block

* coverage

* more

* more races

* more races

* more

* missed some

* more fixes

* missed some more

* fix

* remove unneeded

* one more race

* two
2024-03-30 00:16:53 -04:00
Joost Lekkerkerker 6bb4e7d62c
Bump ruff to 0.3.4 (#112690)
Co-authored-by: Sid <27780930+autinerd@users.noreply.github.com>
Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-03-26 00:02:16 +01:00
J. Nick Koston 8141a246b0
Remove unrelated patching from scrape test (#113951)
https://github.com/home-assistant/core/pull/105516#discussion_r1534459365

The fixture already is designed to go unavailable on the 3rd update
2024-03-21 19:54:24 +01:00
G Johansson 9289fa23a1
Add availability to Scrape config flow (#105516) 2024-03-21 13:13:25 +01:00
Marc Mueller aa16a9d707
Add empty line after module docstring (3) (#112750) 2024-03-08 20:38:34 +01:00
Marc Mueller 7d6251ca08
Add empty line after module docstring [tests q-s] (#112711) 2024-03-08 14:47:22 +01:00
Robert Resch dfea1c2b7c
Remove NONE_SENTINEL in favor of optional select in scrape (#101278)
Co-authored-by: Erik Montnemery <erik@montnemery.com>
2023-10-11 17:41:31 +02:00
G Johansson fd2edf6c0a
Allow remove devices in Scrape (#101229) 2023-10-06 13:33:28 +02:00
Ville Skyttä 9da192c752
Avoid use of `datetime.utc*` methods deprecated in Python 3.12 (#93684)
Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
2023-08-24 16:38:22 +02:00
G Johansson 61c17291fb
Move TemplateEntity to template (#98957)
* Move TemplateEntity to template

* Rename template_entity in helpers
2023-08-24 15:37:04 +02:00
G Johansson d9906b63b7
Add `payload` to Scrape config flow (#98412)
Payload to config flow
2023-08-21 15:47:11 +02:00
G Johansson c312dcbc4b
Scrape refactor to ManualTriggerEntity (#96329) 2023-07-25 00:54:19 +02:00
epenet 4f54e33f67
Allow removal of sensor settings in scrape (#90412)
* Allow removal of sensor settings in scrape

* Adjust

* Adjust

* Add comment

* Simplify

* Simplify

* Adjust

* Don't allow empty string

* Only allow None

* Use default as None

* Use sentinel "none"

* Not needed

* Adjust unit of measurement

* Add translation keys for "none"

* Use translations

* Sort

* Add enum and timestamp

* Use translation references

* Remove default and set suggested_values

* Disallow enum device class

* Adjust tests

* Adjust _strip_sentinel
2023-03-31 14:34:20 +02:00
Olivier Ouellet 1c465b5ad0
Add encoding configuration setting to REST and Scape (#90254)
* Create new config parameter for default character encoding if no character encoding is declared

* Changes suggested by gjohansson-ST

* Added config flow for scape

* Removed "character"

* Change to create_async_httpx_client

* Remove CONF_ENCODING from Scrape SENSOR_SCHEMA

* Debug scrape test
2023-03-28 12:42:31 +02:00
G Johansson 624860da0e
Remove deprecated platform yaml in Scrape (#90272)
* Deprecate platform yaml

* typing

* DiscoveryInfoType
2023-03-27 08:05:30 +02:00
epenet 80ee196fd8
Add type hints to integration tests (part 19) (#88178) 2023-02-15 18:07:40 +01:00
Franck Nijhof 5e81d28116
Update black to 23.1.0 (#87188) 2023-02-02 18:35:24 +01:00
Michael 9709391b52
Replace the usage of unit constants by enumerations in Tests [s-u] (#85937) 2023-01-16 09:00:27 +01:00
Jonno12345 5e04a87cc6
Fix Scrape integration for date and timestamp devices (#84480)
* Scrape integration fix for date and timestamp devices

* Changes advised by PR review. Merged test source and used walrus operator
2022-12-28 10:16:14 +01:00
epenet cbf8a41eed
Add ability to edit sensors in scrape config flow (#82926)
* Add ability to edit sensors in scrape config flow

* Fix docstring

* Update homeassistant/components/scrape/config_flow.py

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

* docstring

Co-authored-by: Erik Montnemery <erik@montnemery.com>
2022-11-30 14:16:28 +01:00
epenet 92fef0f2ba
Improve resource validation in scrape config flow (#82965)
* Improve resource validation in scrape

* Coverage
2022-11-30 14:05:01 +01:00
epenet 23831d746e
Add ability to remove sensors in scrape config flow (#82912)
* Add ability to remove sensors in scrape config flow

* Add test

* Cleanup registry

* Cleanup

* Adjust comments

* Fix bad cleanup
2022-11-29 13:36:33 +01:00
epenet 53e05dec02
Add ability to add sensors in scrape config flow (#82802)
* Add ability to add sensors in scrape config flow

* Fix menu

* Adjust comment

* Use sentinel

* Adjust docstring
2022-11-29 10:13:38 +01:00
G Johansson a63581b5c8
Add unique id for Scrape config entry entities (#82508)
* scrape unique id

* fix uuid str

* add back UoM
2022-11-24 21:12:47 +01:00
G Johansson b3dd59f202
Add config flow to Scrape (#81193)
* Scrape take 2

* cleanup

* new entity name

* Fix name, add tests

* Use FlowResultType

* Add test abort

* hassfest

* Remove not needed test

* clean

* Remove config entry and implement datacoordinator

* fix codeowners

* fix codeowners

* codeowners reset

* Fix coordinator

* Remove test config_flow

* Fix tests

* hassfest

* reset config flow

* reset strings

* reset sensor

* Reconfig

* Fix tests

* coverage

* Remove coverage

* Remove print

* Add config flow

* Fix config flow

* Add back init

* Add entry to sensor

* float to int

* Fix SelectSelector

* Add tests for config entry to existing

* Test config flow

* Fix test reload

* Fix rebase

* Fix strings

* clean init

* Clean test_sensor

* Align sensor setup entry

* Add error to strings

* review changes

* clean tests

* Add back options flow

* review changes

* update_listener

* Add tests

* Remove duplicate abort

* strings

* sensors to sensor

* review changes

* more review changes

* clarify test payload

* fixture name
2022-11-21 21:39:39 +01:00
epenet 4cce359960
Fix legacy scrape scan interval (#81764)
* Fix legacy scrape scan interval

* Adjust init

* Adjust tests

* Clearer default
2022-11-15 13:39:30 +01:00
G Johansson 93d74cafdc
Fix late review comments for Scrape (#81259)
* Review comments from #74325

* Remove moved test

* Fix init

* Handle no data

* Remove print

* Fix tests

* PlatformNotReady if no data

* Recover failed platform setup

* Fix broken test

* patch context

* reset test init

* Move to platform

* asyncio gather

* Remove duplicate code
2022-11-02 17:52:36 +01:00
G Johansson 662aee17a6
Scrape move yaml config to integration key (#74325)
* Scrape take 2

* cleanup

* new entity name

* Fix name, add tests

* Use FlowResultType

* Add test abort

* issue

* hassfest

* Remove not needed test

* clean

* Remove config entry and implement datacoordinator

* fix codeowners

* fix codeowners

* codeowners reset

* Fix coordinator

* Remove test config_flow

* Fix tests

* hassfest

* reset config flow

* reset strings

* reset sensor

* next version

* Reconfig

* Adjust sensor

* cleanup sensor

* cleanup init

* Fix tests

* coverage

* Guard against empty sensor

* naming

* Remove coverage

* Review comments

* Remove print

* Move sensor check
2022-10-30 13:02:11 +01:00
epenet 3d42a46871
Align Scrape resource model with Rest integration (#81074) 2022-10-27 17:48:35 +02:00
epenet ec4b8c49fe
Add unique_id to scrape (#80581)
* Add unique_id to scrape

* Add tests
2022-10-24 15:14:43 +02:00
epenet 64d6d04ade
Use DataUpdateCoordinator in scrape (#80593)
* Add DataUpdateCoordinator to scrape

* Fix tests
2022-10-24 14:55:57 +02:00
epenet 7bc2712142
Adjust root-import in tests (#78761)
* Adjust root-import in tests

* Adjust diagnostics

* Adjust button

* Adjust select

* Adjust device_tracker

* Adjust camera

* Adjust humidifier

* Adjust media_source

* Adjust update

* Adjust siren

* Adjust number

* Adjust alarm_control_panel

* Adjust notify

* Adjust sensor

* Adjust switch

* Revert anthemav

* Don't adjust demo humidifier
2022-09-19 15:22:23 +02:00
J. Nick Koston 1288085b31
Revert scrape changes to 2022.6.6 (#74305) 2022-07-01 10:10:40 -07:00
G Johansson 8d0dd1fe8c
Config flow for scrape integration (#70476) 2022-06-03 09:24:04 -10:00
G Johansson 6d20e68e6d
Code quality scrape (#65441) 2022-02-12 08:28:54 -06:00