Skip to content

Commit

Permalink
Remove useless enoceanmqtt modules copy
Browse files Browse the repository at this point in the history
  • Loading branch information
olivierkeke committed Nov 29, 2023
1 parent 779c29d commit 451f07f
Show file tree
Hide file tree
Showing 9 changed files with 48 additions and 699 deletions.
File renamed without changes.
45 changes: 45 additions & 0 deletions HA_enoceanmqtt/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import logging
import traceback

from enoceanmqtt.communicator import Communicator
from enoceanmqtt.enoceanmqtt import conf, parse_args, setup_logging, load_config_file


def main():
"""entry point if called as an executable"""
# logging.getLogger().setLevel(logging.DEBUG)
# Parse command line arguments
conf.update(parse_args())

# setup logger
setup_logging(conf['logfile'], logging.DEBUG if conf['debug'] else logging.INFO)

# load config file
sensors, global_config = load_config_file(conf['config'])
conf.update(global_config)

# Select the overlay
if str(global_config.get('overlay')).lower() == "ha":
try:
from enoceanmqtt.overlays.homeassistant.ha_communicator import HACommunicator
except ImportError:
logging.error("Unable to import Home Assistant overlay")
return
logging.info("Selected overlay : Home Assistant")
com = HACommunicator(conf, sensors)
else:
logging.info("Selected overlay : None")
com = Communicator(conf, sensors)

# start working
try:
com.run()

# catch all possible exceptions
except: # pylint: disable=broad-except,bare-except
logging.error(traceback.format_exc())


# check for execution
if __name__ == "__main__":
main()
Empty file.
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@

import enocean.utils
from enoceanmqtt.communicator import Communicator
from enoceanmqtt.overlays.homeassistant.device_manager import DeviceManager

from HA_enoceanmqtt.overlays.homeassistant.device_manager import DeviceManager


class HACommunicator(Communicator):
'''Home Assistant-oriented Communicator subclass for enoceanmqtt'''
Expand Down
Loading

0 comments on commit 451f07f

Please sign in to comment.