Skip to content

Commit

Permalink
Fix startup and dep missing
Browse files Browse the repository at this point in the history
  • Loading branch information
Psychokiller1888 committed Jul 16, 2022
1 parent 19231a9 commit 2d61c09
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 8 deletions.
2 changes: 1 addition & 1 deletion install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ if [[ "$device" != "don't overwrite existing parameters" ]]; then
esac
done

defaultConfigurationPath=${USERDIR}'/.config/hermesLedControl'
defaultConfigurationPath=${USERDIR}'/.config/HermesLedControl'
echo "Where should the configuration be saved to?"
read -p "Path (${defaultConfigurationPath})" configurationPath
configurationPath=${configurationPath:-$defaultConfigurationPath}
Expand Down
7 changes: 6 additions & 1 deletion interfaces/neopixels.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@
try:
import rpi_ws281x as ws
except ImportError:
import _rpi_ws281x as ws
try:
import _rpi_ws281x as ws
except ImportError:
subprocess.run(['./venv/bin/pip', 'install', 'rpi_ws281x'])
# noinspection PyUnresolvedReferences
import rpi_ws281x as ws


class Neopixels(Interface):
Expand Down
14 changes: 13 additions & 1 deletion libraries/neopixel.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
# Adafruit NeoPixel library port to the rpi_ws281x library.
# Author: Tony DiCola ([email protected]), Jeremy Garff ([email protected])
import _rpi_ws281x as ws
import subprocess


try:
import rpi_ws281x as ws
except ImportError:
try:
import _rpi_ws281x as ws
except ImportError:
subprocess.run(['./venv/bin/pip', 'install', 'rpi_ws281x'])
# noinspection PyUnresolvedReferences
import rpi_ws281x as ws

import atexit


Expand Down
2 changes: 1 addition & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def onStop():


def main():
_logger.info('Starting Hermes Led Control version 3.0.3')
_logger.info('Starting Hermes Led Control version 3.0.4')

signal.signal(signal.SIGINT, stopHandler)
signal.signal(signal.SIGTERM, stopHandler)
Expand Down
2 changes: 1 addition & 1 deletion models/Configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ def parseArguments() -> argparse.Namespace:
'--hermesLedControlConfig',
help='Define the configuration.yml file location for hermes led control',
type=str,
default='~/.config/hermesLedControl/configuration.yml'
default='~/.config/HermesLedControl/configuration.yml'
)
parser.add_argument(
'--debug',
Expand Down
5 changes: 2 additions & 3 deletions models/engines/ProjectAlice.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import argparse
import json
import logging
import os
from pathlib import Path
from typing import Dict, Optional

Expand Down Expand Up @@ -30,8 +29,8 @@ def loadConfig(self, params: argparse.Namespace) -> Optional[Dict]:

self._logger.info('Loading configurations')

userHomePath = os.path.expanduser('~')
configPath = userHomePath + '/ProjectAlice/config.json'
userHomePath = Path.home()
configPath = userHomePath / 'ProjectAlice/config.json'
path = Path(params.pathToConfig or configPath)

configs = dict()
Expand Down

0 comments on commit 2d61c09

Please sign in to comment.