116 lines
4.5 KiB
Python
116 lines
4.5 KiB
Python
from devdi import rooms
|
|
|
|
|
|
#
|
|
# rooms
|
|
#
|
|
class ffe_livingroom(rooms.ffe_livingroom):
|
|
def __init__(self, mqtt_client):
|
|
super().__init__(mqtt_client)
|
|
# Enable/disable hue device, on power on/off
|
|
self.switch_main_light.add_callback(self.switch_main_light.KEY_OUTPUT_0, True, self.light_main_light.power_on)
|
|
self.switch_main_light.add_callback(self.switch_main_light.KEY_OUTPUT_0, False, self.light_main_light.power_off)
|
|
|
|
|
|
class ffe_kitchen(rooms.ffe_kitchen):
|
|
def __init__(self, mqtt_client):
|
|
super().__init__(mqtt_client)
|
|
# Enable/disable hue device, on power on/off
|
|
self.switch_main_light.add_callback(self.switch_main_light.KEY_OUTPUT_0, True, self.light_main_light.power_on)
|
|
self.switch_main_light.add_callback(self.switch_main_light.KEY_OUTPUT_0, False, self.light_main_light.power_off)
|
|
|
|
|
|
class ffe_sleep(rooms.ffe_sleep):
|
|
def __init__(self, mqtt_client):
|
|
super().__init__(mqtt_client)
|
|
# Enable/disable hue device, on power on/off
|
|
self.switch_main_light.add_callback(self.switch_main_light.KEY_OUTPUT_0, True, self.light_main_light.power_on)
|
|
self.switch_main_light.add_callback(self.switch_main_light.KEY_OUTPUT_0, False, self.light_main_light.power_off)
|
|
|
|
|
|
class ffw_julian(rooms.ffw_julian):
|
|
def __init__(self, mqtt_client):
|
|
super().__init__(mqtt_client)
|
|
# Enable/disable hue device, on power on/off
|
|
self.switch_main_light.add_callback(self.switch_main_light.KEY_OUTPUT_0, True, self.light_main_light.power_on)
|
|
self.switch_main_light.add_callback(self.switch_main_light.KEY_OUTPUT_0, False, self.light_main_light.power_off)
|
|
|
|
|
|
class ffw_livingroom(rooms.ffw_livingroom):
|
|
def __init__(self, mqtt_client):
|
|
super().__init__(mqtt_client)
|
|
# Enable/disable hue device, on power on/off
|
|
self.switch_main_light.add_callback(self.switch_main_light.KEY_OUTPUT_0, True, self.light_main_light.power_on)
|
|
self.switch_main_light.add_callback(self.switch_main_light.KEY_OUTPUT_0, False, self.light_main_light.power_off)
|
|
|
|
|
|
class ffw_sleep(rooms.ffw_sleep):
|
|
def __init__(self, mqtt_client):
|
|
super().__init__(mqtt_client)
|
|
# Enable/disable hue device, on power on/off
|
|
self.switch_main_light.add_callback(self.switch_main_light.KEY_OUTPUT_0, True, self.light_main_light.power_on)
|
|
self.switch_main_light.add_callback(self.switch_main_light.KEY_OUTPUT_0, False, self.light_main_light.power_off)
|
|
|
|
|
|
class gfw_dirk(rooms.gfw_dirk):
|
|
def __init__(self, mqtt_client):
|
|
super().__init__(mqtt_client)
|
|
# Enable/disable hue device, on power on/off
|
|
self.switch_main_light.add_callback(self.switch_main_light.KEY_OUTPUT_0, True, self.light_main_light.power_on)
|
|
self.switch_main_light.add_callback(self.switch_main_light.KEY_OUTPUT_0, False, self.light_main_light.power_off)
|
|
|
|
|
|
class gfw_floor(rooms.gfw_floor):
|
|
def __init__(self, mqtt_client):
|
|
super().__init__(mqtt_client)
|
|
# Enable/disable hue device, on power on/off
|
|
self.switch_main_light.add_callback(self.switch_main_light.KEY_OUTPUT_0, True, self.light_main_light.power_on)
|
|
self.switch_main_light.add_callback(self.switch_main_light.KEY_OUTPUT_0, False, self.light_main_light.power_off)
|
|
|
|
|
|
#
|
|
# Locations
|
|
#
|
|
class ffe(object):
|
|
def __init__(self, mqtt_client):
|
|
self.diningroom = rooms.ffe_diningroom(mqtt_client)
|
|
self.floor = rooms.ffe_floor(mqtt_client)
|
|
self.kitchen = ffe_kitchen(mqtt_client)
|
|
self.livingroom = ffe_livingroom(mqtt_client)
|
|
self.sleep = ffe_sleep(mqtt_client)
|
|
|
|
|
|
class ffw(object):
|
|
def __init__(self, mqtt_client):
|
|
self.bath = rooms.ffw_bath(mqtt_client)
|
|
self.floor = rooms.ffw_floor(mqtt_client)
|
|
self.julian = ffw_julian(mqtt_client)
|
|
self.livingroom = ffw_livingroom(mqtt_client)
|
|
self.sleep = ffw_sleep(mqtt_client)
|
|
|
|
|
|
class gar(object):
|
|
def __init__(self, mqtt_client):
|
|
self.garden = rooms.gar_garden(mqtt_client)
|
|
|
|
|
|
class gfw(object):
|
|
def __init__(self, mqtt_client):
|
|
self.dirk = gfw_dirk(mqtt_client)
|
|
self.floor = gfw_floor(mqtt_client)
|
|
self.marion = rooms.gfw_marion(mqtt_client)
|
|
|
|
|
|
class stw(object):
|
|
def __init__(self, mqtt_client):
|
|
self.stairway = rooms.stairway(mqtt_client)
|
|
|
|
|
|
class house(object):
|
|
def __init__(self, mqtt_client):
|
|
self.ffe = ffe(mqtt_client)
|
|
self.ffw = ffw(mqtt_client)
|
|
self.gar = gar(mqtt_client)
|
|
self.gfw = gfw(mqtt_client)
|
|
self.stw = stw(mqtt_client)
|