Commit Graph
345 Commits
Author SHA1 Message Date
Michael 7f6b8bbd1e Add strict type annotations to aladdin_connect (#50693)
* add strict type annotations

* add missing return type annotation
2021-05-15 23:53:42 +03:00
Michael bc006c9ecc Add strict type annotations to aftership (#50692)
* add strict type annotations

* import PLATFORM_SCHEMA as BASE_PLATFORM_SCHEMA

* bring needed return back
2021-05-15 23:53:10 +03:00
Martin Hjelmare 5da64d01e2 Fix smhi typing (#50690) 2021-05-15 21:38:12 +02:00
Michael 562e0d785d Add strict type annotations to acer_projector (#50657) 2021-05-15 19:55:28 +02:00
Michael 25b2fd0cee Add strict typing to fritzbox (#50486)
* enable strict typing

* apply suggestions

* set defaults for FritzboxConfigFlow

* improvements and suggestions

* another suggestion

* tweaks

* tweaks
2021-05-15 07:54:11 +02:00
Ville Skyttä ed10856cc4 UpCloud API and typing update (#50624) 2021-05-14 21:49:41 -07:00
c220e70008 Add integration kraken (#31114)
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2021-05-14 08:02:11 -07:00
Ruslan Sayfutdinov 35f304450c Enable type checks for stream component (#50527)
* Enable type checks for stream component

* Fix pylint
2021-05-13 23:26:11 +02:00
e616583bad Improve types for Fritz (#50327)
Co-authored-by: Ruslan Sayfutdinov <ruslan@sayfutdinov.com>
Co-authored-by: Maciej Bieniek <bieniu@users.noreply.github.com>
2021-05-11 10:41:27 -05:00
epenet d6c99a3db9 Enable strict type checks for onewire (#50422) 2021-05-11 17:28:17 +02:00
Maciej Bieniek f5541a468e Improve type annotations for GIOS integration (#50454) 2021-05-11 07:57:24 -07:00
Ruslan Sayfutdinov 8e2b3aab44 Enable strict type checks for camera platform (#50395) 2021-05-10 15:12:15 +02:00
Ruslan Sayfutdinov 3a192896df Enable some strict mypy checks globally (#50398)
* Enable some strict mypy checks globally

* Update mypy.ini
2021-05-10 14:20:25 +02:00
Michael 042822e35e Improve typing for synology_dsm (#49656) 2021-05-09 22:44:55 +02:00
Shay Levy be73067f9c Fix Shelly type hints (#50322) 2021-05-09 19:46:53 +02:00
Dermot Duffy 4e4042a869 Fix types for WLED (#50001) 2021-05-09 19:34:21 +02:00
Ruslan Sayfutdinov 9b058551f7 Enable type checks for camera platform (#50179) 2021-05-09 18:04:57 +02:00
Gleb Sinyavskiy 52b1a416d9 Remove the N26 integration (#50292) 2021-05-09 00:58:23 +02:00
Maciej Bieniek 6df0190aeb Improve type annotations for Airly integration (#49898) 2021-05-07 09:47:52 -05:00
Maciej Bieniek 0587f834df Add Nettigo Air Monitor integration (#49099) 2021-05-07 08:59:29 -05:00
Franck Nijhof e3e9239798 Strictly type Twente Milieu integration (#50062) 2021-05-05 22:04:09 -07:00
Milan Meulemans a0feee083c Fix and enable type checks in Rituals Perfume Genie (#49947) 2021-05-04 14:47:17 +02:00
Dermot Duffy 809c1394d4 Enable mypy for motionEye (aye aye!) (#49738) 2021-05-04 08:19:41 +02:00
jan iversen f0ec9c38b0 Fix modbus typing (#49938)
Add changes needed to please mypy and follow the coding rules
of the project.
2021-05-03 22:45:21 +02:00
Ruslan Sayfutdinov 5fd8e7008e Create separate entries for each component in mypy.ini (#50030) 2021-05-03 18:45:38 +02:00
Dermot Duffy e8446cb4d9 Fix types for shell command (#50004) 2021-05-03 10:43:23 +02:00
jan iversen ebee5f7808 Fix ihc typing (#49946) 2021-05-01 21:01:56 +02:00
jan iversenandRobert Svensson 60ae230499 Please mypy (axis). (#49949)
* Please mypy (axis).

* Update homeassistant/components/axis/config_flow.py

Co-authored-by: Robert Svensson <Kane610@users.noreply.github.com>

Co-authored-by: Robert Svensson <Kane610@users.noreply.github.com>
2021-05-01 16:13:43 +02:00
Franck Nijhof dc46a213a7 Enable strict typing for the Elgato integration (#49920) 2021-04-30 13:21:30 -07:00
Maciej Bieniek 3210c086ef Improve type annotations for the Brother integration (#49771) 2021-04-29 16:59:31 +02:00
Ruslan Sayfutdinov 02764c2f46 Disable strict type checks for tests (#49851) 2021-04-29 15:57:02 +02:00
Ruslan Sayfutdinov 2adc6d62e5 Replace .no-strict-typing with .strict-typing (#49762) 2021-04-27 09:13:11 -07:00
Ruslan Sayfutdinov 37466ae423 Don't ignore mypy errors by default (#49270) 2021-04-26 14:23:21 +02:00
Ville Skyttä f9b1a52259 Move mypy settings to setup.cfg (#25611) 2019-08-01 07:53:53 +02:00
Paulus Schoutsen 39b8102ce6 Bump Python support to min Python 3.6.0 (#25582)
* Bump Python support to min Python 3.6.0

* Fix type
2019-07-30 16:44:39 -07:00
Ville Skyttä b230562c76 Mypy config cleanups (#25475)
* Move file specific config to inline comments

* Disallow untyped defs by default everywhere
2019-07-25 08:08:20 +02:00
Ville Skyttä fc5b1c7005 Mypy config improvements (#25340)
* Specify python version

So that it type checks against the lowest common denominator version,
not the runtime one.

* Disallow incomplete definitions
2019-07-20 14:35:59 -07:00
Ville Skyttä 56841da2d3 Upgrade mypy to 0.720, turn on unreachability warnings (#25157)
* Upgrade mypy to 0.720

* Turn on mypy unreachability warnings, address raised issues
2019-07-16 15:11:38 -07:00
Ties de Kock 4004867eda Split up yaml loaders into multiple files (#23774)
* Start moving parts of yaml utils to own module

Move parts of yaml loader out of the single large file and start
to create the structure of the yaml loaders in Ansible [0].

[0]: https://github.com/ansible/ansible/tree/devel/lib/ansible/parsing/yaml

* Finish yaml migration, update tests and mocks

  * Move code around to finish the migration
  * Update the mocks so that `open` is patched in
    `homeassistant.util.yaml.loader` instead of
    `homeassistant.util.yaml`.
  * Updated mypy ignores
  * Updated external API of `homeasistant.util.yaml`, see below:

Checked what part of the api of `homeassistant.util.yaml` was actually
called from outside the tests and added an `__ALL__` that contains only
these elements.

Updated the tests so that references to internal parts of the API (e.g.
the yaml module imported into `homeassistant.util.yaml.loader`) are
referenced directly from `homeassistant.util.yaml.loader`.

In `tests/test_yaml.py` the import `yaml` refers to
`homeassistant.util.yaml` and `yaml_loader` refers to `~.loader`.

Future work that remains for the next iteration is to create a custom
SafeConstructor and refers to that instead of monkey patching `yaml` with
custom loaders.

* Update mocks in yaml dumper, check_config
2019-05-09 09:07:56 -07:00
Ville Skyttä f434e24252 Upgrade mypy (#23586)
* Upgrade mypy to 0.701

* Enable strict equality checks

* Strict equality error fixes

* StateMachine.is_state docstring fix
2019-05-02 21:18:20 +03:00
Ville Skyttä 3800f00564 Disable assuming Optional type for values with None default (#16029)
https://www.python.org/dev/peps/pep-0484/#union-types
"Type checkers should move towards requiring the optional type to be
made explicit."
2018-08-17 20:22:49 +02:00
Andrey 8ee3b535ef Add disallow_untyped_calls to mypy check. (#15661)
* Add disallow_untyped_calls to mypy check.

* Fix generator
2018-07-31 15:00:17 +01:00
Andrey 140a874917 Add typing to homeassistant/*.py and homeassistant/util/ (#15569)
* Add typing to homeassistant/*.py and homeassistant/util/

* Fix wrong merge

* Restore iterable in OrderedSet

* Fix tests
2018-07-23 10:24:39 +02:00
Andrey 24d2261060 Add check_untyped_defs (#15510)
* Add check_untyped_defs

* Change to regular if-else
2018-07-18 00:28:44 +02:00
Andrey e60f9ca392 More typing (#15449)
## Description:

More typing improvements.

Switch to using `mypy.ini` for flexibility

Add `warn_return_any` check except in `homeassistant.util.yaml` that does typing hacks. Fix some type annotations as resulting from this check and ignore others were fixing is hard.

## Checklist:
  - [x] The code change is tested and works locally.
  - [x] Local tests pass with `tox`. **Your PR cannot be merged unless tests pass**
2018-07-13 20:14:45 +03:00