Skip to content

Commit fc93ad4

Browse files
authored
Add details about typed ConfigEntry in runtime-data and strict-typing IQS rule (#2479)
1 parent 295afde commit fc93ad4

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

docs/core/integration-quality-scale/rules/runtime-data.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
title: "Use ConfigEntry.runtime_data to store runtime data"
33
related_rules:
4+
- strict-typing
45
- test-before-setup
56
---
67
import RelatedRules from './_includes/related_rules.jsx'
@@ -35,6 +36,10 @@ async def async_setup_entry(hass: HomeAssistant, entry: MyIntegrationConfigEntry
3536
return True
3637
```
3738

39+
:::info
40+
If the integration implements `strict-typing`, the use of a custom typed `MyIntegrationConfigEntry` is required and must be used throughout.
41+
:::
42+
3843
## Additional resources
3944

4045
More information about configuration entries and their lifecycle can be found in the [config entry documentation](/docs/config_entries_index).
@@ -45,4 +50,4 @@ There are no exceptions to this rule.
4550

4651
## Related rules
4752

48-
<RelatedRules relatedRules={frontMatter.related_rules}></RelatedRules>
53+
<RelatedRules relatedRules={frontMatter.related_rules}></RelatedRules>

docs/core/integration-quality-scale/rules/strict-typing.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
---
22
title: "Strict typing"
3+
related_rules:
4+
- runtime-data
35
---
6+
import RelatedRules from './_includes/related_rules.jsx'
47

58
## Reasoning
69

@@ -15,10 +18,18 @@ This file tells mypy that your library is fully typed, after which it can read t
1518

1619
In the Home Assistant codebase, you can add your integration to the [`.strict-typing`](https://github.com/home-assistant/core/blob/dev/.strict-typing) file, which will enable strict type checks for your integration.
1720

21+
:::warning
22+
If the integration implements `runtime-data`, the use of a custom typed `MyIntegrationConfigEntry` is required and must be used throughout.
23+
:::
24+
1825
## Additional resources
1926

2027
To read more about the `py.typed` file, see [PEP-561](https://peps.python.org/pep-0561/).
2128

2229
## Exceptions
2330

24-
There are no exceptions to this rule.
31+
There are no exceptions to this rule.
32+
33+
## Related rules
34+
35+
<RelatedRules relatedRules={frontMatter.related_rules}></RelatedRules>

0 commit comments

Comments
 (0)