Initial Configuration Push

This commit is contained in:
CCOSTAN
2016-10-11 16:42:06 +00:00
parent b83eeadfcb
commit 5127bc2109
2145 changed files with 298464 additions and 0 deletions

21
deps/netdisco/discoverables/homekit.py vendored Normal file
View File

@@ -0,0 +1,21 @@
"""Discover myStrom devices."""
from . import MDNSDiscoverable
# pylint: disable=too-few-public-methods
class Discoverable(MDNSDiscoverable):
"""Add support for discovering myStrom switches."""
def __init__(self, nd):
super(Discoverable, self).__init__(nd, '_hap._tcp.local.')
def info_from_entry(self, entry):
"""Return the most important info from mDNS entries."""
info = {key.decode('utf-8'): value.decode('utf-8')
for key, value in entry.properties.items()}
info['host'] = 'http://{}'.format(self.ip_from_host(entry.server))
return info
def get_info(self):
"""Get details from myStrom devices."""
return [self.info_from_entry(entry) for entry in self.get_entries()]