config file to volume
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
#docker-compose file, because it contains passwords
|
||||
config.yml
|
||||
config.yaml
|
||||
config/config.yaml
|
||||
config/config.yml
|
||||
|
||||
# Byte-compiled / optimized / DLL files
|
||||
__pycache__/
|
||||
|
||||
@@ -7,6 +7,5 @@ RUN pip install --upgrade pip && pip install -r /requirements.txt
|
||||
|
||||
WORKDIR /app
|
||||
COPY src /app
|
||||
ADD config.yaml /app/
|
||||
|
||||
CMD ["python", "-u", "/app/main.py"]
|
||||
|
||||
@@ -7,6 +7,5 @@ RUN pip install --upgrade pip && pip install -r /requirements.txt
|
||||
|
||||
WORKDIR /app
|
||||
COPY src /app
|
||||
ADD config.yaml /app/
|
||||
|
||||
CMD ["python", "-u", "/app/main.py"]
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
mqtt:
|
||||
server: 192.168.1.2
|
||||
port: 1883
|
||||
username: username
|
||||
password: passw0rd
|
||||
prefix: home
|
||||
|
||||
gateway:
|
||||
password: passw0rd
|
||||
|
||||
sids:
|
||||
# motion
|
||||
158d0000e7c7ad:
|
||||
model: motion
|
||||
name: hall
|
||||
|
||||
# temperature
|
||||
158d0001149b3c:
|
||||
model: sensor_ht
|
||||
name: living
|
||||
|
||||
# plugs
|
||||
158d00010dd98d:
|
||||
model: plug
|
||||
name: heater
|
||||
|
||||
# buttons
|
||||
158d00012d5720:
|
||||
model: switch
|
||||
name: kitchen
|
||||
|
||||
# cube
|
||||
158d00011065e3:
|
||||
model: cube
|
||||
name: main
|
||||
|
||||
# gateway
|
||||
f0b429aa1463:
|
||||
model: gateway
|
||||
name: main
|
||||
@@ -2,5 +2,7 @@ xiaomi:
|
||||
build: .
|
||||
dockerfile: Dockerfile-i386
|
||||
container_name: xiaomi
|
||||
volumes:
|
||||
- "./config:/app/config"
|
||||
net: host
|
||||
restart: always
|
||||
|
||||
+1
-1
@@ -46,7 +46,7 @@ def process_mqtt_messages(gateway, client):
|
||||
|
||||
if __name__ == "__main__":
|
||||
_LOGGER.info("Loading config file...")
|
||||
config=yamlparser.load_yaml('config.yaml')
|
||||
config=yamlparser.load_yaml('config/config.yaml')
|
||||
gateway_pass = yamlparser.get_gateway_password(config)
|
||||
|
||||
_LOGGER.info("Init mqtt client.")
|
||||
|
||||
Reference in New Issue
Block a user