Smarthome Functionen
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

first_floor_west.py 3.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. #
  4. import config
  5. import devices
  6. from function.modules import heating_function
  7. from function.rooms import room, room_collection
  8. from function.videv import videv_switch_brightness, videv_switch_brightness_color_temp, videv_heating
  9. import logging
  10. try:
  11. from config import APP_NAME as ROOT_LOGGER_NAME
  12. except ImportError:
  13. ROOT_LOGGER_NAME = 'root'
  14. logger = logging.getLogger(ROOT_LOGGER_NAME).getChild(__name__)
  15. class first_floor_west(room_collection):
  16. def __init__(self, mqtt_client):
  17. super().__init__(mqtt_client)
  18. self.bath = first_floor_west_bath(mqtt_client)
  19. self.julian = first_floor_west_julian(mqtt_client)
  20. self.livingroom = first_floor_west_living(mqtt_client)
  21. self.sleep = first_floor_west_sleep(mqtt_client)
  22. class first_floor_west_julian(room):
  23. def __init__(self, mqtt_client):
  24. #
  25. # Device initialisation
  26. #
  27. # http://shelly1l-3C6105E43452
  28. self.main_light_shelly = devices.shelly(mqtt_client, config.TOPIC_FFW_JULIAN_MAIN_LIGHT_SHELLY)
  29. self.main_light_tradfri = devices.tradfri_light(mqtt_client, config.TOPIC_FFW_JULIAN_MAIN_LIGHT_ZIGBEE)
  30. super().__init__(mqtt_client)
  31. #
  32. # Virtual Device Interface
  33. #
  34. self.main_light_videv = videv_switch_brightness_color_temp(
  35. mqtt_client, config.TOPIC_FFW_JULIAN_MAIN_LIGHT_VIDEV,
  36. self.main_light_shelly, devices.shelly.KEY_OUTPUT_0,
  37. self.main_light_tradfri, devices.tradfri_light.KEY_BRIGHTNESS,
  38. self.main_light_tradfri, devices.tradfri_light.KEY_COLOR_TEMP
  39. )
  40. class first_floor_west_bath(room):
  41. def __init__(self, mqtt_client):
  42. #
  43. # Device initialisation
  44. #
  45. self.heating_valve = devices.brennenstuhl_heatingvalve(mqtt_client, config.TOPIC_FFW_BATH_HEATING_VALVE_ZIGBEE)
  46. super().__init__(mqtt_client)
  47. #
  48. # Functionality initialisation
  49. #
  50. # heating function
  51. self.heating_function = heating_function(self.heating_valve)
  52. #
  53. # Virtual Device Interface
  54. #
  55. self.heating_function_videv = videv_heating(
  56. mqtt_client, config.TOPIC_FFW_BATH_HEATING_VALVE_VIDEV,
  57. self.heating_function
  58. )
  59. class first_floor_west_living(room):
  60. def __init__(self, mqtt_client):
  61. #
  62. # Device initialisation
  63. #
  64. # http://shelly1l-84CCA8ACE6A1
  65. self.main_light_shelly = devices.shelly(mqtt_client, config.TOPIC_FFW_LIVINGROOM_MAIN_LIGHT_SHELLY)
  66. self.main_light_tradfri = devices.tradfri_light(mqtt_client, config.TOPIC_FFW_LIVINGROOM_MAIN_LIGHT_ZIGBEE)
  67. super().__init__(mqtt_client)
  68. #
  69. # Virtual Device Interface
  70. #
  71. self.main_light_videv = videv_switch_brightness_color_temp(
  72. mqtt_client, config.TOPIC_FFW_LIVINGROOM_MAIN_LIGHT_VIDEV,
  73. self.main_light_shelly, devices.shelly.KEY_OUTPUT_0,
  74. self.main_light_tradfri, devices.tradfri_light.KEY_BRIGHTNESS,
  75. self.main_light_tradfri, devices.tradfri_light.KEY_COLOR_TEMP
  76. )
  77. class first_floor_west_sleep(room):
  78. def __init__(self, mqtt_client):
  79. #
  80. # Device initialisation
  81. #
  82. # http://shelly1-3494546A51F2
  83. self.main_light_shelly = devices.shelly(mqtt_client, config.TOPIC_FFW_SLEEP_MAIN_LIGHT_SHELLY)
  84. self.main_light_tradfri = devices.tradfri_light(mqtt_client, config.TOPIC_FFW_SLEEP_MAIN_LIGHT_ZIGBEE)
  85. super().__init__(mqtt_client)
  86. #
  87. # Virtual Device Interface
  88. #
  89. self.main_light_videv = videv_switch_brightness(
  90. mqtt_client, config.TOPIC_FFW_SLEEP_MAIN_LIGHT_VIDEV,
  91. self.main_light_shelly, devices.shelly.KEY_OUTPUT_0,
  92. self.main_light_tradfri, devices.tradfri_light.KEY_BRIGHTNESS
  93. )