Marc Mueller
34bd291615
Use PEP 695 for decorator typing (1) ( #117638 )
2024-05-17 16:27:02 +02:00
Marc Mueller
d779333bef
Use TypeVarTuple for add_job and run_job methods ( #114122 )
2024-03-24 18:52:39 +01:00
Sid
82a60fe8ad
Enable Ruff RSE ( #113695 )
2024-03-18 00:40:38 +01:00
Marc Mueller
8809d3aa88
Add empty line after module docstring [g-i] ( #112699 )
2024-03-08 08:52:48 -05:00
Marc Mueller
eb8f8e1ae4
Use aiohttp.AppKey for http ban keys ( #112657 )
2024-03-08 11:13:24 +01:00
Marc Mueller
531e25cbc6
Change KEY_HASS to be an aiohttp AppKey ( #111954 )
2024-03-07 13:37:48 +01:00
J. Nick Koston
c1750f7c3a
Fix circular imports in core integrations ( #111875 )
...
* Fix circular imports in core integrations
* fix circular import
* fix more circular imports
* fix more circular imports
* fix more circular imports
* fix more circular imports
* fix more circular imports
* fix more circular imports
* fix more circular imports
* adjust
* fix
* increase timeout
* remove unused logger
* keep up to date
* make sure its reprod
2024-02-29 21:04:41 -05:00
Ville Skyttä
24b1e01d71
Update Ruff to 0.1.8, avoid linter/formatter conflicts ( #106080 )
...
* Disable Ruff rules that may conflict with the formatter
* Upgrade Ruff to 0.1.8
- https://github.com/astral-sh/ruff/releases/tag/v0.1.7
- https://github.com/astral-sh/ruff/releases/tag/v0.1.8
* Format with Ruff 0.1.8
2023-12-20 23:55:09 +01:00
Chuck Foster
aca48b5e45
Fix duplicate Ban file entries ( #103953 )
2023-11-14 17:13:14 +01:00
J. Nick Koston
da1780f9ec
Small cleanups to process_success_login ( #103282 )
2023-11-07 10:48:34 +01:00
Marc Mueller
45b4b0e990
Import ParamSpec
from typing [Py310] ( #86413 )
...
* Import ParamSpec from typing [Py310]
* Update additional imports
2023-01-23 07:28:43 +01:00
Franck Nijhof
79b52a2b41
Stricter pylint message control ( #86154 )
2023-01-20 13:47:55 +01:00
Franck Nijhof
cb13418bab
String formatting and max line length - Part 2 ( #84393 )
2022-12-22 11:38:59 +01:00
Joakim Plate
8bd4125390
Test corrections noticed during pytest upgrade ( #82579 )
...
* Withing trigger a call to coordinator after init
* Stop discovery task on STOP event
* Stop dsmr connection task on STOP
* Use autospec in modem_serial tests
close on AioSerial is non async, and should not be mocked as a coroutine
* Make sure responder is specced correctly
tests/components/emulated_hue/test_init.py::test_setup_works
/Users/joakim/src/hass/home-assistant/homeassistant/components/emulated_hue/__init__.py:119: RuntimeWarning: coroutine 'AsyncMockMixin._execute_mock_call' was never awaited
protocol.close()
* Don't assume Pymodbus is the only thing logging
* Use gather instead of wait
```
homeassistant/components/homeassistant/__init__.py:208: DeprecationWarning: The explicit passing of coroutine objects to asyncio.wait() is deprecated since Python 3.8, and scheduled for removal in Python 3.11.
```
* Increase wait time for automation tests
Assuming exit within 1 seconds is unreasonable on a potentially loaded
test machine.
* Avoid changing app state after startup
2022-11-23 20:53:28 +01:00
Marc Mueller
b1ed1543c8
Improve http decorator typing ( #75541 )
2022-07-21 13:07:42 +02:00
Franck Nijhof
9a4a7e2f4d
Extend failed login message with the request URL ( #75218 )
2022-07-14 21:43:14 +02:00
J. Nick Koston
0c29b68cf8
Switch linear search to a dict lookup for ip bans ( #74482 )
2022-07-07 10:57:44 +02:00
Marc Mueller
93cbb331e5
Update Mypy to 0.950 ( #70948 )
...
Co-authored-by: J. Nick Koston <nick@koston.org>
2022-04-27 20:49:54 -05:00
Marc Mueller
370832f527
Fix http typing ( #66506 )
2022-02-14 13:40:31 +01:00
epenet
6f631c542c
Import hassio ( #64561 )
...
* Import hassio
* Fix HassioAPIError
* Use relative import
* Adjust import
Co-authored-by: epenet <epenet@users.noreply.github.com>
2022-01-20 19:03:26 +01:00
Erik Montnemery
2eab3c8de1
Import persistent notification (part 3) ( #63900 )
2022-01-11 09:51:16 -08:00
Ville Skyttä
b52c5c82b1
Use http.HTTPStatus in components/[gh]* ( #58246 )
2021-10-23 20:34:53 +02:00
Marc Mueller
10bfc78365
Fix missing encoding with open() ( #53593 )
...
* Fix missing encoding with open()
* Fix tests
* Improve open - frontend
2021-07-28 09:41:45 +02:00
Ruslan Sayfutdinov
ce15f28642
Add missing type hints in http component ( #50411 )
2021-05-10 14:30:47 -07:00
Franck Nijhof
6932cf9534
Use contextlib.suppress where possible ( #48189 )
2021-03-23 14:36:43 +01:00
Marc Mueller
5cdd945f44
Update typing 08 ( #48058 )
2021-03-18 09:25:40 +01:00
gregod
cf9ea6f82d
Sanitize user-agent in wrong_login message ( #45251 )
2021-01-18 09:21:30 +01:00
Paulus Schoutsen
20ed40d7ad
Use utcnow from date util for http.ban ( #43686 )
2020-11-27 17:04:52 +01:00
J. Nick Koston
3267823165
Update http to use async_add_executor_job ( #41529 )
2020-10-09 09:29:07 +02:00
Franck Nijhof
1c2ebdf307
Upgrade black to 20.8b1 ( #39287 )
2020-08-27 13:56:20 +02:00
Franck Nijhof
475e70986b
Extend IP ban / failed login notification information ( #39020 )
2020-08-18 23:32:19 +02:00
Franck Nijhof
cc4ebc925c
Improve X-Forwarded-* request headers handling ( #38696 )
...
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: Franck Nijhof <git@frenck.dev>
Co-authored-by: Pascal Vizeli <pvizeli@syshack.ch>
2020-08-11 22:57:50 +02:00
springstan
4c38e6cfa5
Use HTTP_BAD_REQUEST constant ( #33797 )
2020-04-09 21:43:42 +02:00
Martin Hjelmare
c3decc6531
Do not ban supervisor ip if set ( #33781 )
...
* Use asynctest patch instead of mock_coro
* Add test for supervisor ip ban
* Do not ban supervisor ip if set
* Extract supervisor ip helper
* Check supervisor ip before banning
* Remove added blank line
* Clean up get supervisor ip
Co-Authored-By: Pascal Vizeli <pvizeli@syshack.ch>
Co-authored-by: Pascal Vizeli <pvizeli@syshack.ch>
2020-04-08 10:31:44 -07:00
springstan
157f972d72
Use f-strings in integrations starting with "H" - "L" ( #32265 )
...
* Use f-strings in integrations starting with "H"
* Use f-strings in integrations starting with "I"
* Use f-strings in integrations starting with "J"
* Use f-strings in integrations starting with "K"
* Use f-strings in integrations starting with "L"
* Fix lint error
* Use join instead of f-string in homekit_controller
* Use local variables with f-strings
* Fix lint error
* Escape the characters in f-string
* Sort imports with isort in homeworks light
* Fix pylint error
* Fix broken tests
* Fix broken tests v2
2020-02-28 12:39:29 +01:00
Ville Skyttä
e6388e186c
Remove unnecessary string literal concatenations ( #30360 )
2020-01-02 21:17:10 +02:00
springstan
04722fdd63
Move imports to top for http ( #29500 )
2019-12-05 13:42:09 +01:00
Ville Skyttä
54242cd65c
Type hint additions ( #26765 )
2019-09-20 08:23:34 -07:00
Franck Nijhof
decf13b948
Use literal string interpolation in core (f-strings) ( #26166 )
2019-08-23 09:53:33 -07:00
Ville Skyttä
b738082dad
Type check various base components ( #25878 )
...
* Type check various component base classes, disabling bunch of checks for now
* Type hint fixes
* Help mypy out some
* Add more type hints
2019-08-11 20:38:18 -07:00
Paulus Schoutsen
4de97abc3a
Black
2019-07-31 12:25:30 -07:00
Paulus Schoutsen
e356d0bcda
Better handle file not found when loading YAML ( #23908 )
...
* Better handle file not found
* Lint
2019-05-19 12:01:29 +02:00
Fabian Affolter
3736120c6a
Update file header ( #21061 )
...
* Update file header
* Fix lint issue
* Fix lint issue
2019-02-14 16:01:46 +01:00
Louis Matthijssen
d39784906b
Fix HTTP login attempts check triggering too late ( #20431 )
2019-01-26 03:13:44 +01:00
Paulus Schoutsen
1341ecd2eb
Use proper signals ( #18613 )
...
* Emulated Hue not use deprecated handler
* Remove no longer needed workaround
* Add middleware directly
* Dont always load the ban config file
* Update homeassistant/components/http/ban.py
Co-Authored-By: balloob <paulus@home-assistant.io>
* Update __init__.py
2018-11-21 20:55:21 +01:00
Jerad Meisner
50fb59477a
Store notifications in component. Add ws endpoint for fetching. ( #16503 )
...
* Store notifications in component. Add ws endpoint for fetching.
* Comments
2018-09-11 11:39:30 +02:00
Ville Skyttä
dd9d53c83e
Update pydocstyle to 2.1.1 and flake8-docstrings to 1.3.0 ( #14557 )
...
* Update pydocstyle to 2.1.1 and flake8-docstrings to 1.3.0
* Pydocstyle D401 fixes
2018-08-24 10:28:43 +02:00
Jason Hu
d7690c5fda
Add ipban for failed login attempt in new login flow ( #15551 )
...
* Add ipban for failed login attempt in new login flow
* Address review comment
* Use decorator to clean up code
2018-07-24 10:09:52 +02:00
Jason Hu
f1286f8e6b
Reset failed login attempts counter when login success ( #15564 )
2018-07-20 12:09:48 +02:00
Ville Skyttä
2f7b79764a
More pylint 2 fixes ( #15565 )
...
## Description:
More fixes flagged by pylint 2 that don't hurt to have before the actual pylint 2 upgrade (which I'll submit soon).
## Checklist:
- [ ] The code change is tested and works locally.
- [x] Local tests pass with `tox`. **Your PR cannot be merged unless tests pass**
2018-07-20 11:45:20 +03:00