blob: 40a7b70ed3d357797fa979bd1d0f8554abc0d789 (
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
|
#!/usr/bin/env python3
"""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)
|