Device definitions and intialisation
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

props.py 4.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. import devices
  2. #
  3. # Device TYpe definitions
  4. #
  5. DTY_SHY_SW1 = 1
  6. """ Shelly """
  7. DTY_TLI_Sxx = 2
  8. """ Tradfri Light (Switching only) """
  9. DTY_TLI_SBx = 3
  10. """ Tradfri Light (Switching and Brightnes) """
  11. DTY_TLI_SBT = 4
  12. """ Tradfri Light (Switching, Brightnes and Colortemperature) """
  13. DTY_TIN_5xx = 5
  14. """ Tradfri Input Device (5 Buttons) """
  15. DTY_LLI_SBT = 6
  16. """ Livarno Light (Switching, Brightnes and Colortemperature) """
  17. DTY_BVL_xxx = 7
  18. """ Brennenstuhl Heatingvalve """
  19. DTY_SPP_SW1 = 8
  20. """ Silvercrest Powerplug """
  21. DTY_SMS_xxx = 9
  22. """ Silvercrest Motion Sensor """
  23. DTY_MPP_4xx = 10
  24. """ My Powerplug (4 plugs) """
  25. DTY_MAS_xxx = 11
  26. """ My Audio status (MPD) """
  27. DTY_MRE_xxx = 12
  28. """ My Remote control """
  29. def dty_repr(dty):
  30. return {
  31. DTY_SHY_SW1: devices.shelly_sw1,
  32. DTY_TLI_Sxx: devices.tradfri_sw,
  33. DTY_TLI_SBx: devices.tradfri_sw_br,
  34. DTY_TLI_SBT: devices.tradfri_sw_br_ct,
  35. DTY_TIN_5xx: devices.tradfri_button,
  36. DTY_LLI_SBT: devices.livarno_sw_br_ct,
  37. DTY_BVL_xxx: devices.brennenstuhl_heatingvalve,
  38. DTY_SPP_SW1: devices.silvercrest_powerplug,
  39. DTY_SMS_xxx: devices.silvercrest_motion_sensor,
  40. DTY_MPP_4xx: devices.my_powerplug,
  41. DTY_MAS_xxx: devices.audio_status,
  42. DTY_MRE_xxx: devices.remote,
  43. }.get(dty)
  44. #
  45. # Source Transmission Group
  46. #
  47. STG_ZGW = 1
  48. """ Zigbee ground floor west """
  49. STG_ZFW = 2
  50. """ Zigbee first floor west """
  51. STG_ZFE = 3
  52. """ Zigbee first floor east """
  53. STG_SHE = 4
  54. """ Shellies """
  55. STG_MYA = 5
  56. """ My Applications """
  57. def stg_repr(stg):
  58. return {
  59. STG_ZGW: 'zigbee/gfw', # TODO: -> zigbee_gfw
  60. STG_ZFW: 'zigbee/ffw', # TODO: -> zigbee_ffw
  61. STG_ZFE: 'zigbee/ffe', # TODO: -> zigbee_ffe
  62. STG_SHE: 'shellies',
  63. STG_MYA: 'my_apps',
  64. }.get(stg)
  65. #
  66. # LOCation
  67. #
  68. LOC_GFW = 1
  69. """ Grounf floor west """
  70. LOC_GFE = 2
  71. """ Ground floor east """
  72. LOC_STW = 3
  73. """ Stairway """
  74. LOC_FFW = 4
  75. """ First floor west """
  76. LOC_FFE = 5
  77. """ First floor east """
  78. def loc_repr(loc):
  79. return {
  80. LOC_GFW: 'gfw',
  81. LOC_GFE: 'gfe',
  82. LOC_STW: 'stw',
  83. LOC_FFW: 'ffw',
  84. LOC_FFE: 'ffe',
  85. }.get(loc)
  86. #
  87. # ROOms
  88. #
  89. ROO_DIN = 1
  90. """ Diningroom """
  91. ROO_KIT = 2
  92. """ Kitchen """
  93. ROO_LIV = 3
  94. """ Livingroom """
  95. ROO_FLO = 4
  96. """ Floor """
  97. ROO_SLP = 5
  98. """ Sleep """
  99. ROO_BAT = 6
  100. """ Bath """
  101. ROO_DIR = 7
  102. """ Dirk """
  103. ROO_MAR = 8
  104. """ Marion """
  105. ROO_JUL = 9
  106. """ Julian """
  107. ROO_STW = 10
  108. """ Stairway """
  109. def roo_repr(roo):
  110. return {
  111. ROO_DIN: 'diningroom',
  112. ROO_KIT: 'kitchen',
  113. ROO_LIV: 'livingroom',
  114. ROO_FLO: 'floor',
  115. ROO_SLP: 'sleep',
  116. ROO_BAT: 'bath',
  117. ROO_DIR: 'dirk',
  118. ROO_MAR: 'marion',
  119. ROO_JUL: 'julian',
  120. ROO_STW: 'stairway',
  121. }.get(roo)
  122. #
  123. # FUNctions
  124. #
  125. FUN_MAL = 1
  126. """ Main Light """
  127. FUN_DEL = 2
  128. """ Desk Light """
  129. FUN_FLL = 3
  130. """ Floor Light """
  131. FUN_BLD = 4
  132. """ Bed Light Dirk """
  133. FUN_BLM = 5
  134. """ Bed Light Marion """
  135. FUN_HEA = 6
  136. """ Heating """
  137. FUN_MPP = 7
  138. """ Multiple Powerplugs """
  139. FUN_CTR = 8
  140. """ Control """
  141. FUN_CIR = 9
  142. """ Circulation Pump """
  143. FUN_GAR = 10
  144. """ Garland """
  145. FUN_XTR = 11
  146. """ X-Mas Tree """
  147. FUN_XST = 12
  148. """ X-Mas Star """
  149. FUN_MSE = 13
  150. """ Motion Sensor """
  151. FUN_RCA = 14
  152. """ Remote Control Amplifier """
  153. FUN_RCC = 15
  154. """ Remote Control CD-Player """
  155. FUN_ASS = 16
  156. """ Audio status spotify """
  157. FUN_ASM = 17
  158. """ Audio status mpd """
  159. def fun_repr(fun):
  160. return {
  161. FUN_MAL: 'main_light',
  162. FUN_DEL: 'desk_light',
  163. FUN_FLL: 'floorlamp', # TODO: -> floor_light
  164. FUN_BLD: 'bed_light_di',
  165. FUN_BLM: 'bed_light_ma',
  166. FUN_HEA: 'heating_valve', # TODO: -> heating
  167. FUN_MPP: 'powerplug',
  168. FUN_CTR: 'input_device',
  169. FUN_CIR: 'circulation_pump',
  170. FUN_GAR: 'garland',
  171. FUN_XTR: 'xmas-tree',
  172. FUN_XST: 'xmas-star',
  173. FUN_MSE: 'motion_sensor',
  174. FUN_RCA: 'remote_ctrl_amp',
  175. FUN_RCC: 'remote_ctrl_cd',
  176. FUN_ASS: 'audio_status_spotify',
  177. FUN_ASM: 'audio_status_mpd',
  178. }.get(fun)