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

3 statements  

« prev     ^ index     » next       coverage.py v7.16.2, created at 2026-10-26 20:57 +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 only have voluptuous. 

5 

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

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

8""" 

9 

10from typing import TYPE_CHECKING 

11 

12if TYPE_CHECKING: 

13 import probatio as vol 

14else: 

15 import voluptuous as vol 

16 

17__all__ = ["vol"]