## 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**
## 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**
## Description:
Make typing checks more strict: add `--strict-optional` flag that forbids implicit None return type. This flag will become default in the next version of mypy (0.600)
Add `homeassistant/util/` to checked dirs.
## Checklist:
- [x] The code change is tested and works locally.
- [x] Local tests pass with `tox`. **Your PR cannot be merged unless tests pass**
* Add storage helper
* Migrate config entries to use the storage helper
* Make sure tests do not do I/O
* Lint
* Add versions to stored data
* Add more instance variables
* Make migrator load config if nothing to migrate
* Address comments
* phue -> aiohue
* Clean up
* Fix config
* Address comments
* Typo
* Fix rebase error
* Mark light as unavailable when bridge is disconnected
* Tests
* Make Throttle work with double delay and async
* Rework update logic
* Don't resolve host to IP
* Clarify comment
* No longer do unnecessary updates
* Add more doc
* Another comment update
* Wrap up tests
* Lint
* Fix tests
* PyLint does not like mix 'n match async and coroutine
* Lint
* Update aiohue to 1.2
* Lint
* Fix await MagicMock
* Lazy loading of service descriptions
* Fix tests
* Load YAML in executor
* Return a copy of available services to allow mutations
* Remove lint
* Add zha/services.yaml
* Only cache descriptions for known services
* Remove lint
* Remove description loading during service registration
* Remove description parameter from async_register
* Test async_get_all_descriptions
* Remove lint
* Fix typos from multi-edit
* Remove unused arguments
* Remove unused import os
* Remove unused import os, part 2
* Remove unneeded coroutine decorator
* Only use executor for loading files
* Cleanups suggested in review
* Increase test coverage
* Fix races in existing tests
* Recorder exception catch for long state string
* Revert - Recorder exception catch for long state string
* Validate state length at core level
* Revert - this reverts commit 9d6bd017d9.
* Revert - Recorder exception catch for long state string
* Fix state TypeError
* Test for long state exception
* Add initial version
* Fix requirements
* Prefer logging over printing
* Set executor thread name on >Py36 only
* Add tests
* Lint
* Add restrictedpython to test dependencies
* Create python_script.py
From doc:
```
However, an empty dict ({}) is treated as is. If you want to specify a list that can contain anything, specify it as dict:
>>> schema = Schema({}, extra=ALLOW_EXTRA) # don't do this
>>> try:
... schema({'extra': 1})
... raise AssertionError('MultipleInvalid not raised')
... except MultipleInvalid as e:
... exc = e
>>> str(exc) == "not a valid value"
True
>>> schema({})
{}
>>> schema = Schema(dict) # do this instead
>>> schema({})
{}
>>> schema({'extra': 1})
{'extra': 1}
```
* Always return True/False from is_state and is_state_attr
These functions are documented to always return True/False but the
short-circuit evaluation would return None if the entity_id did not exist.
* Reword into a single statement
* Fire EVENT_HOMEASSISTANT_START automations off right away while starting
* Actually have core state be set to 'starting' during boot
* Fix correct start implementation
* Test and deprecate event automation platform on start
* Fix doc strings
* Remove shutting down exception
* More strict when to mark an instance as finished
* Add automation platform to listen for start/shutdown
* When we stop we should wait till it's all done
* Fix testing
* Fix async bugs in tests
* Only set UVLOOP when hass starts from CLI
* This hangs normal asyncio event loop
* Clean up Z-Wave node entity test
* Add support for remove services / Reload script support
* Reload support for scripts
* Add more unittest for services
* Add unittest for script reload
* Address paulus comments
* Core cleanup: two stage shutdown
* fix spell
* fix
* add async logger to close
* change aiohttp to use CLOSE
* address paulus comments
* Fix tests
* Add unittest
* Move core servcie from core to components
* add new handler for signals/exception
* Static persistent id
* Move unittest
* fix coro/callback
* Add more unittest for new services
* Address comments
* Update __init__.py
* Check config before restarting.
* Make check_config on restart async
* don't check if notification service exists
* Use .communicate()
* Reduce the number of notifications. Add tests.