# PEP 484 stubs for Home Assistant Core
[![CI](https://github.com/KapJI/homeassistant-stubs/actions/workflows/ci.yaml/badge.svg)](https://github.com/KapJI/homeassistant-stubs/actions/workflows/ci.yaml)
[![PyPI version](https://img.shields.io/pypi/v/homeassistant-stubs)](https://pypi.org/project/homeassistant-stubs/)
This is unofficial stub-only package generated from [Home Assistant Core](https://github.com/home-assistant/core) sources.
You can use it to enable type checks against Home Assistant code in your custom component or AppDaemon app.
## How to use
Add it to dev dependencies of your project.
I recommend to use [Poetry](https://python-poetry.org/) for managing dependencies:
```shell
poetry add --dev homeassistant-stubs
```
Please note that only stubs from strictly typed modules are added in this package.
This includes all core modules and some components.
Generic components like `sensor`, `light` or `media_player` are already typed.
If your project imports not yet typed components, `mypy` will be unable to find that module.
The best thing you can do to fix this is to submit PR to HA Core which adds type hints for these components.
After that stubs for these components will become available in this package.
## Motivation
Home Assistant maintainers don't want to distribute typing information with `homeassistant` package
([[1]](https://github.com/home-assistant/core/pull/28866),
[[2]](https://github.com/home-assistant/core/pull/47796)).
The reason is that [PEP 561](https://www.python.org/dev/peps/pep-0561/#packaging-type-information)
says that `py.typed` marker is applied recursively and the whole package must support type checking.
But many of the Home Assistant components are currently not type checked.
## How it works
- `update_stubs.py` script extracts list of strictly typed modules from Home Assistant `setup.cfg`.
- Then it runs `stubgen` which is shipped with `mypy` to generate typing stubs.
- New versions are generated and published automatically every 12 hours.
没有合适的资源?快使用搜索试试~ 我知道了~
PyPI 官网下载 | homeassistant-stubs-2021.12.2.tar.gz
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 189 浏览量
2022-01-12
06:08:07
上传
评论
收藏 307KB GZ 举报
温馨提示
共1007个文件
pyi:1002个
py:1个
pkg-info:1个
资源来自pypi官网。 资源全名:homeassistant-stubs-2021.12.2.tar.gz
资源推荐
资源详情
资源评论
收起资源包目录
PyPI 官网下载 | homeassistant-stubs-2021.12.2.tar.gz (1007个子文件)
LICENSE 1KB
README.md 2KB
PKG-INFO 3KB
setup.py 11KB
const.pyi 16KB
__init__.pyi 14KB
core.pyi 13KB
template.pyi 11KB
config_entries.pyi 11KB
api.pyi 10KB
script.pyi 9KB
event.pyi 9KB
__init__.pyi 8KB
entity.pyi 8KB
device_registry.pyi 8KB
entity_registry.pyi 8KB
legacy.pyi 8KB
entity.pyi 8KB
schema.pyi 8KB
config_validation.pyi 7KB
config_flow.pyi 7KB
media_player.pyi 6KB
discovery_data_template.pyi 6KB
media_player.pyi 6KB
statistics.pyi 6KB
camera.pyi 6KB
__init__.pyi 6KB
condition.pyi 6KB
sensor.pyi 6KB
__init__.pyi 6KB
__init__.pyi 6KB
light.pyi 6KB
loader.pyi 6KB
__init__.pyi 5KB
switch.pyi 5KB
__init__.pyi 5KB
__init__.pyi 5KB
common.pyi 5KB
__init__.pyi 5KB
__init__.pyi 5KB
service.pyi 5KB
__init__.pyi 5KB
__init__.pyi 5KB
__init__.pyi 5KB
data_entry_flow.pyi 5KB
sensor.pyi 5KB
climate.pyi 5KB
__init__.pyi 5KB
__init__.pyi 5KB
config.pyi 5KB
sensor.pyi 5KB
__init__.pyi 5KB
config_entry_oauth2_flow.pyi 5KB
timeout.pyi 4KB
entity_platform.pyi 4KB
__init__.pyi 4KB
media_player.pyi 4KB
climate.pyi 4KB
switch.pyi 4KB
binary_sensor.pyi 4KB
light.pyi 4KB
collection.pyi 4KB
climate.pyi 4KB
__init__.pyi 4KB
__init__.pyi 4KB
light.pyi 4KB
sensor.pyi 4KB
media_player.pyi 4KB
core.pyi 4KB
__init__.pyi 4KB
migrate.pyi 4KB
base_platform.pyi 4KB
__init__.pyi 4KB
__init__.pyi 4KB
__init__.pyi 4KB
sensor.pyi 4KB
__init__.pyi 4KB
recorder.pyi 4KB
climate_sdm.pyi 4KB
commands.pyi 4KB
__init__.pyi 4KB
addon.pyi 4KB
device_trigger.pyi 4KB
discovery.pyi 4KB
binary_sensor.pyi 4KB
sensor.pyi 4KB
cover.pyi 4KB
__init__.pyi 4KB
fan.pyi 4KB
__init__.pyi 4KB
vacuum.pyi 3KB
sensor.pyi 3KB
sensor.pyi 3KB
camera.pyi 3KB
config_flow.pyi 3KB
climate.pyi 3KB
sensor.pyi 3KB
device_condition.pyi 3KB
color.pyi 3KB
bridge.pyi 3KB
共 1007 条
- 1
- 2
- 3
- 4
- 5
- 6
- 11
资源评论
挣扎的蓝藻
- 粉丝: 13w+
- 资源: 15万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功