1234567891011121314151617181920212223242526272829 |
-
-
-
-
- import logging
- import task
-
- try:
- from config import APP_NAME as ROOT_LOGGER_NAME
- except ImportError:
- ROOT_LOGGER_NAME = 'root'
- logger = logging.getLogger(ROOT_LOGGER_NAME).getChild(__name__)
-
-
-
-
-
-
-
- class room(object):
- def __init__(self, mqtt_client):
- self.mqtt_client = mqtt_client
-
- def all_off(self, device=None, key=None, data=None):
- logger.info("Switching all off \"%s\"", type(self).__name__)
- try:
- self.main_light_shelly.all_off()
- except AttributeError:
- logger.exception("Device self.main_light does not exist!")
|