blob: 0c0ca989b80898735a675ddb662f2a372dd28245 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
#!/usr/bin/env python3
# © Copyright 2021-2022, Scott Gasch
"""General utility functions involving smart home devices."""
import logging
from typing import Any
from smart_home import cameras, chromecasts, lights, outlets
logger = logging.getLogger(__name__)
def is_camera(device: Any) -> bool:
return isinstance(device, cameras.BaseCamera)
def is_chromecast(device: Any) -> bool:
return isinstance(device, chromecasts.BaseChromecast)
def is_light(device: Any) -> bool:
return isinstance(device, lights.BaseLight)
def is_outlet(device: Any) -> bool:
return isinstance(device, outlets.BaseOutlet)
|