Smarthome Functionen
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

first_floor_west.py 3.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  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
  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_julian(room):
  16. def __init__(self, mqtt_client):
  17. #
  18. # Device initialisation
  19. #
  20. # http://shelly1l-3C6105E43452
  21. self.main_light_shelly = devices.shelly(mqtt_client, config.TOPIC_FFW_JULIAN_MAIN_LIGHT_SHELLY)
  22. self.main_light_tradfri = devices.tradfri_light(mqtt_client, config.TOPIC_FFW_JULIAN_MAIN_LIGHT_ZIGBEE)
  23. super().__init__(mqtt_client)
  24. #
  25. # Virtual Device Interface
  26. #
  27. self.main_light_videv = videv_switch_brightness_color_temp(
  28. mqtt_client, config.TOPIC_FFW_JULIAN_MAIN_LIGHT_VIDEV,
  29. self.main_light_shelly, devices.shelly.KEY_OUTPUT_0,
  30. self.main_light_tradfri, devices.tradfri_light.KEY_BRIGHTNESS,
  31. self.main_light_tradfri, devices.tradfri_light.KEY_COLOR_TEMP
  32. )
  33. class first_floor_west_bath(room):
  34. def __init__(self, mqtt_client):
  35. #
  36. # Device initialisation
  37. #
  38. self.heating_valve = devices.brennenstuhl_heatingvalve(mqtt_client, config.TOPIC_FFW_BATH_HEATING_VALVE_ZIGBEE)
  39. super().__init__(mqtt_client)
  40. #
  41. # Functionality initialisation
  42. #
  43. # heating function
  44. self.heating_function = heating_function(self.heating_valve, config.DEFAULT_TEMPERATURE_FFW_BATH)
  45. #
  46. # Virtual Device Interface
  47. #
  48. self.heating_function_videv = videv_heating(
  49. mqtt_client, config.TOPIC_FFW_BATH_HEATING_VALVE_VIDEV,
  50. self.heating_function
  51. )
  52. class first_floor_west_living(room):
  53. def __init__(self, mqtt_client):
  54. #
  55. # Device initialisation
  56. #
  57. # http://shelly1l-84CCA8ACE6A1
  58. self.main_light_shelly = devices.shelly(mqtt_client, config.TOPIC_FFW_LIVINGROOM_MAIN_LIGHT_SHELLY)
  59. self.main_light_tradfri = devices.tradfri_light(mqtt_client, config.TOPIC_FFW_LIVINGROOM_MAIN_LIGHT_ZIGBEE)
  60. super().__init__(mqtt_client)
  61. #
  62. # Virtual Device Interface
  63. #
  64. self.main_light_videv = videv_switch_brightness_color_temp(
  65. mqtt_client, config.TOPIC_FFW_LIVINGROOM_MAIN_LIGHT_VIDEV,
  66. self.main_light_shelly, devices.shelly.KEY_OUTPUT_0,
  67. self.main_light_tradfri, devices.tradfri_light.KEY_BRIGHTNESS,
  68. self.main_light_tradfri, devices.tradfri_light.KEY_COLOR_TEMP
  69. )
  70. class first_floor_west_sleep(room):
  71. def __init__(self, mqtt_client):
  72. #
  73. # Device initialisation
  74. #
  75. # http://shelly1-3494546A51F2
  76. self.main_light_shelly = devices.shelly(mqtt_client, config.TOPIC_FFW_SLEEP_MAIN_LIGHT_SHELLY)
  77. self.main_light_tradfri = devices.tradfri_light(mqtt_client, config.TOPIC_FFW_SLEEP_MAIN_LIGHT_ZIGBEE)
  78. super().__init__(mqtt_client)
  79. #
  80. # Virtual Device Interface
  81. #
  82. self.main_light_videv = videv_switch_brightness(
  83. mqtt_client, config.TOPIC_FFW_SLEEP_MAIN_LIGHT_VIDEV,
  84. self.main_light_shelly, devices.shelly.KEY_OUTPUT_0,
  85. self.main_light_tradfri, devices.tradfri_light.KEY_BRIGHTNESS
  86. )