186 line
4.0 KiB
Python
186 line
4.0 KiB
Python
import devices
|
|
|
|
|
|
#
|
|
# Device TYpe definitions
|
|
#
|
|
DTY_SHY_SW1 = 1
|
|
""" Shelly """
|
|
DTY_TLI_Sxx = 2
|
|
""" Tradfri Light (Switching only) """
|
|
DTY_TLI_SBx = 3
|
|
""" Tradfri Light (Switching and Brightnes) """
|
|
DTY_TLI_SBT = 4
|
|
""" Tradfri Light (Switching, Brightnes and Colortemperature) """
|
|
DTY_TIN_5xx = 5
|
|
""" Tradfri Input Device (5 Buttons) """
|
|
DTY_LLI_SBT = 6
|
|
""" Livarno Light (Switching, Brightnes and Colortemperature) """
|
|
DTY_BVL_xxx = 7
|
|
""" Brennenstuhl Heatingvalve """
|
|
DTY_SPP_SW1 = 8
|
|
""" Silvercrest Powerplug """
|
|
DTY_SMS_xxx = 9
|
|
""" Silvercrest Motion Sensor """
|
|
DTY_MPP_4xx = 10
|
|
""" My Powerplug (4 plugs) """
|
|
DTY_MAS_xxx = 11
|
|
""" My Audio status (MPD) """
|
|
DTY_MRE_xxx = 12
|
|
""" My Remote control """
|
|
def dty_repr(dty):
|
|
return {
|
|
DTY_SHY_SW1: devices.shelly_sw1,
|
|
DTY_TLI_Sxx: devices.tradfri_sw,
|
|
DTY_TLI_SBx: devices.tradfri_sw_br,
|
|
DTY_TLI_SBT: devices.tradfri_sw_br_ct,
|
|
DTY_TIN_5xx: devices.tradfri_button,
|
|
DTY_LLI_SBT: devices.livarno_sw_br_ct,
|
|
DTY_BVL_xxx: devices.brennenstuhl_heatingvalve,
|
|
DTY_SPP_SW1: devices.silvercrest_powerplug,
|
|
DTY_SMS_xxx: devices.silvercrest_motion_sensor,
|
|
DTY_MPP_4xx: devices.my_powerplug,
|
|
DTY_MAS_xxx: devices.audio_status,
|
|
DTY_MRE_xxx: devices.remote,
|
|
}.get(dty)
|
|
|
|
#
|
|
# Source Transmission Group
|
|
#
|
|
STG_ZGW = 1
|
|
""" Zigbee ground floor west """
|
|
STG_ZFW = 2
|
|
""" Zigbee first floor west """
|
|
STG_ZFE = 3
|
|
""" Zigbee first floor east """
|
|
STG_SHE = 4
|
|
""" Shellies """
|
|
STG_MYA = 5
|
|
""" My Applications """
|
|
def stg_repr(stg):
|
|
return {
|
|
STG_ZGW: 'zigbee/gfw', # TODO: -> zigbee_gfw
|
|
STG_ZFW: 'zigbee/ffw', # TODO: -> zigbee_ffw
|
|
STG_ZFE: 'zigbee/ffe', # TODO: -> zigbee_ffe
|
|
STG_SHE: 'shellies',
|
|
STG_MYA: 'my_apps',
|
|
}.get(stg)
|
|
|
|
#
|
|
# LOCation
|
|
#
|
|
LOC_GFW = 1
|
|
""" Grounf floor west """
|
|
LOC_GFE = 2
|
|
""" Ground floor east """
|
|
LOC_STW = 3
|
|
""" Stairway """
|
|
LOC_FFW = 4
|
|
""" First floor west """
|
|
LOC_FFE = 5
|
|
""" First floor east """
|
|
def loc_repr(loc):
|
|
return {
|
|
LOC_GFW: 'gfw',
|
|
LOC_GFE: 'gfe',
|
|
LOC_STW: 'stw',
|
|
LOC_FFW: 'ffw',
|
|
LOC_FFE: 'ffe',
|
|
}.get(loc)
|
|
|
|
#
|
|
# ROOms
|
|
#
|
|
ROO_DIN = 1
|
|
""" Diningroom """
|
|
ROO_KIT = 2
|
|
""" Kitchen """
|
|
ROO_LIV = 3
|
|
""" Livingroom """
|
|
ROO_FLO = 4
|
|
""" Floor """
|
|
ROO_SLP = 5
|
|
""" Sleep """
|
|
ROO_BAT = 6
|
|
""" Bath """
|
|
ROO_DIR = 7
|
|
""" Dirk """
|
|
ROO_MAR = 8
|
|
""" Marion """
|
|
ROO_JUL = 9
|
|
""" Julian """
|
|
ROO_STW = 10
|
|
""" Stairway """
|
|
def roo_repr(roo):
|
|
return {
|
|
ROO_DIN: 'diningroom',
|
|
ROO_KIT: 'kitchen',
|
|
ROO_LIV: 'livingroom',
|
|
ROO_FLO: 'floor',
|
|
ROO_SLP: 'sleep',
|
|
ROO_BAT: 'bath',
|
|
ROO_DIR: 'dirk',
|
|
ROO_MAR: 'marion',
|
|
ROO_JUL: 'julian',
|
|
ROO_STW: 'stairway',
|
|
}.get(roo)
|
|
|
|
#
|
|
# FUNctions
|
|
#
|
|
FUN_MAL = 1
|
|
""" Main Light """
|
|
FUN_DEL = 2
|
|
""" Desk Light """
|
|
FUN_FLL = 3
|
|
""" Floor Light """
|
|
FUN_BLD = 4
|
|
""" Bed Light Dirk """
|
|
FUN_BLM = 5
|
|
""" Bed Light Marion """
|
|
FUN_HEA = 6
|
|
""" Heating """
|
|
FUN_MPP = 7
|
|
""" Multiple Powerplugs """
|
|
FUN_CTR = 8
|
|
""" Control """
|
|
FUN_CIR = 9
|
|
""" Circulation Pump """
|
|
FUN_GAR = 10
|
|
""" Garland """
|
|
FUN_XTR = 11
|
|
""" X-Mas Tree """
|
|
FUN_XST = 12
|
|
""" X-Mas Star """
|
|
FUN_MSE = 13
|
|
""" Motion Sensor """
|
|
FUN_RCA = 14
|
|
""" Remote Control Amplifier """
|
|
FUN_RCC = 15
|
|
""" Remote Control CD-Player """
|
|
FUN_ASS = 16
|
|
""" Audio status spotify """
|
|
FUN_ASM = 17
|
|
""" Audio status mpd """
|
|
|
|
def fun_repr(fun):
|
|
return {
|
|
FUN_MAL: 'main_light',
|
|
FUN_DEL: 'desk_light',
|
|
FUN_FLL: 'floorlamp', # TODO: -> floor_light
|
|
FUN_BLD: 'bed_light_di',
|
|
FUN_BLM: 'bed_light_ma',
|
|
FUN_HEA: 'heating_valve', # TODO: -> heating
|
|
FUN_MPP: 'powerplug',
|
|
FUN_CTR: 'input_device',
|
|
FUN_CIR: 'circulation_pump',
|
|
FUN_GAR: 'garland',
|
|
FUN_XTR: 'xmas-tree',
|
|
FUN_XST: 'xmas-star',
|
|
FUN_MSE: 'motion_sensor',
|
|
FUN_RCA: 'remote_ctrl_amp',
|
|
FUN_RCC: 'remote_ctrl_cd',
|
|
FUN_ASS: 'audio_status_spotify',
|
|
FUN_ASM: 'audio_status_mpd',
|
|
}.get(fun)
|