diff --git a/hassio/bootstrap.py b/hassio/bootstrap.py index 96afa4cc9..d0746395d 100644 --- a/hassio/bootstrap.py +++ b/hassio/bootstrap.py @@ -17,7 +17,7 @@ from .snapshots import SnapshotManager from .tasks import Tasks from .updater import Updater from .services import ServiceManager -from .services.discovery import Discovery +from .services import Discovery from .host import AlsaAudio _LOGGER = logging.getLogger(__name__) diff --git a/hassio/coresys.py b/hassio/coresys.py index 70e239e43..810d11827 100644 --- a/hassio/coresys.py +++ b/hassio/coresys.py @@ -11,7 +11,7 @@ from .misc.scheduler import Scheduler from .misc.systemd import Systemd -class CoreSys(object): +class CoreSys: """Class that handle all shared data.""" def __init__(self, loop): @@ -238,7 +238,7 @@ class CoreSys(object): return self._loop.create_task(coroutine) -class CoreSysAttributes(object): +class CoreSysAttributes: """Inheret basic CoreSysAttributes.""" coresys = None diff --git a/hassio/docker/__init__.py b/hassio/docker/__init__.py index a5733ddbc..e91da35f4 100644 --- a/hassio/docker/__init__.py +++ b/hassio/docker/__init__.py @@ -14,7 +14,7 @@ _LOGGER = logging.getLogger(__name__) CommandReturn = attr.make_class('CommandReturn', ['exit_code', 'output']) -class DockerAPI(object): +class DockerAPI: """Docker hassio wrapper. This class is not AsyncIO safe! diff --git a/hassio/docker/network.py b/hassio/docker/network.py index ee5a8b767..08120c3ce 100644 --- a/hassio/docker/network.py +++ b/hassio/docker/network.py @@ -8,7 +8,7 @@ from ..const import DOCKER_NETWORK_MASK, DOCKER_NETWORK, DOCKER_NETWORK_RANGE _LOGGER = logging.getLogger(__name__) -class DockerNetwork(object): +class DockerNetwork: """Internal HassIO Network. This class is not AsyncIO safe! diff --git a/hassio/docker/stats.py b/hassio/docker/stats.py index be6bb4b7a..300cfccd0 100644 --- a/hassio/docker/stats.py +++ b/hassio/docker/stats.py @@ -2,7 +2,7 @@ from contextlib import suppress -class DockerStats(object): +class DockerStats: """Hold stats data from container inside.""" def __init__(self, stats): diff --git a/hassio/host/__init__.py b/hassio/host/__init__.py index 16b30ad18..a0401a83c 100644 --- a/hassio/host/__init__.py +++ b/hassio/host/__init__.py @@ -1,2 +1,6 @@ """Host function like audio/dbus/systemd.""" + from .alsa import AlsaAudio # noqa + + +class HostManager: diff --git a/hassio/misc/dns.py b/hassio/misc/dns.py index 6b116b849..c7ea30b50 100644 --- a/hassio/misc/dns.py +++ b/hassio/misc/dns.py @@ -8,7 +8,7 @@ _LOGGER = logging.getLogger(__name__) COMMAND = "socat UDP-RECVFROM:53,fork UDP-SENDTO:127.0.0.11:53" -class DNSForward(object): +class DNSForward: """Manage DNS forwarding to internal DNS.""" def __init__(self, loop): diff --git a/hassio/misc/hardware.py b/hassio/misc/hardware.py index 66060d0c4..62e045223 100644 --- a/hassio/misc/hardware.py +++ b/hassio/misc/hardware.py @@ -23,7 +23,7 @@ GPIO_DEVICES = Path("/sys/class/gpio") RE_TTY = re.compile(r"tty[A-Z]+") -class Hardware(object): +class Hardware: """Represent a interface to procfs, sysfs and udev.""" def __init__(self): diff --git a/hassio/misc/scheduler.py b/hassio/misc/scheduler.py index 65cb4be62..44401422c 100644 --- a/hassio/misc/scheduler.py +++ b/hassio/misc/scheduler.py @@ -10,7 +10,7 @@ CALL = 'callback' TASK = 'task' -class Scheduler(object): +class Scheduler: """Schedule task inside HassIO.""" def __init__(self, loop): diff --git a/hassio/misc/systemd.py b/hassio/misc/systemd.py index b9697c79d..5089035e8 100644 --- a/hassio/misc/systemd.py +++ b/hassio/misc/systemd.py @@ -10,7 +10,7 @@ DBUS_NAME = 'org.freedesktop.systemd1' DBUS_OBJECT = '/org/freedesktop/systemd1' -class Systemd(object): +class Systemd: """Systemd function handler.""" def __init__(self): diff --git a/hassio/services/__init__.py b/hassio/services/__init__.py index addd172fa..9d5abe4be 100644 --- a/hassio/services/__init__.py +++ b/hassio/services/__init__.py @@ -1,5 +1,6 @@ """Handle internal services discovery.""" +from .discovery import Discovery # noqa from .mqtt import MQTTService from .data import ServicesData from ..const import SERVICE_MQTT diff --git a/hassio/services/discovery.py b/hassio/services/discovery.py index ac48f88d1..4914e7c44 100644 --- a/hassio/services/discovery.py +++ b/hassio/services/discovery.py @@ -84,7 +84,7 @@ class Discovery(CoreSysAttributes): EVENT_DISCOVERY_DEL, {ATTR_UUID: message.uuid})) -class Message(object): +class Message: """Represent a single Discovery message.""" def __init__(self, provider, component, platform, config, uuid=None): diff --git a/hassio/utils/__init__.py b/hassio/utils/__init__.py index 0e960af4e..57220352d 100644 --- a/hassio/utils/__init__.py +++ b/hassio/utils/__init__.py @@ -27,7 +27,7 @@ def process_lock(method): return wrap_api -class AsyncThrottle(object): +class AsyncThrottle: """ Decorator that prevents a function from being called more than once every time period. diff --git a/hassio/utils/gdbus.py b/hassio/utils/gdbus.py index 8a82bde7d..99e6fc84e 100644 --- a/hassio/utils/gdbus.py +++ b/hassio/utils/gdbus.py @@ -14,7 +14,7 @@ CALL = ("gdbus call --system --dest {bus} --object-path {inf} " "--method {inf}.{method} {args}") -class DBus(object): +class DBus: """DBus handler.""" def __init__(self, bus_name, object_path): @@ -109,7 +109,7 @@ class DBus(object): return DBusCallWrapper(self, interface) -class DBusCallWrapper(object): +class DBusCallWrapper: """Wrapper a DBus interface for a call.""" def __init__(self, dbus, interface): diff --git a/hassio/utils/json.py b/hassio/utils/json.py index fa29f8172..93eb482c2 100644 --- a/hassio/utils/json.py +++ b/hassio/utils/json.py @@ -21,7 +21,7 @@ def read_json_file(jsonfile): return json.loads(cfile.read()) -class JsonConfig(object): +class JsonConfig: """Hass core object for handle it.""" def __init__(self, json_file, schema): diff --git a/hassio/utils/tar.py b/hassio/utils/tar.py index a1f23537c..9d13abe0c 100644 --- a/hassio/utils/tar.py +++ b/hassio/utils/tar.py @@ -12,7 +12,7 @@ MOD_READ = 'r' MOD_WRITE = 'w' -class SecureTarFile(object): +class SecureTarFile: """Handle encrypted files for tarfile library.""" def __init__(self, name, mode, key=None, gzip=True):