2024-05-07 08:53:13 +00:00
|
|
|
"""Implementation for HassDict and custom HassKey types.
|
|
|
|
|
|
|
|
Custom for type checking. See stub file.
|
|
|
|
"""
|
|
|
|
|
|
|
|
from __future__ import annotations
|
|
|
|
|
|
|
|
|
2024-05-20 08:46:50 +00:00
|
|
|
class HassKey[_T](str):
|
2024-05-07 08:53:13 +00:00
|
|
|
"""Generic Hass key type.
|
|
|
|
|
|
|
|
At runtime this is a generic subclass of str.
|
|
|
|
"""
|
|
|
|
|
|
|
|
__slots__ = ()
|
|
|
|
|
|
|
|
|
2024-05-20 08:46:50 +00:00
|
|
|
class HassEntryKey[_T](str):
|
2024-05-07 08:53:13 +00:00
|
|
|
"""Key type for integrations with config entries.
|
|
|
|
|
|
|
|
At runtime this is a generic subclass of str.
|
|
|
|
"""
|
|
|
|
|
|
|
|
__slots__ = ()
|
|
|
|
|
|
|
|
|
|
|
|
HassDict = dict
|