Coverage for custom_components/appliance_autonotify/compat.py: 100%

3 statements  

« prev     ^ index     » next       coverage.py v7.16.2, created at 2026-10-14 15:14 +0000

1"""Schema validation library, for the range of Home Assistant versions supported 

2 

3Home Assistant 2026.10 replaced voluptuous with probatio, aliasing `voluptuous` to it at runtime 

4so that `import voluptuous` carries on working. Earlier versions, supported here until they are 

5more than 6 months old, only have voluptuous. 

6 

7So voluptuous is still what is imported at runtime, whichever library that turns out to be, while 

8type checking is against probatio, since that is what the current Home Assistant type hints expect. 

9""" 

10 

11from typing import TYPE_CHECKING 

12 

13if TYPE_CHECKING: 

14 import probatio as vol 

15else: 

16 import voluptuous as vol 

17 

18__all__ = ["vol"]