quality of life improvements
This commit is contained in:
parent
18ed759c6c
commit
b9822b33e7
4 changed files with 13 additions and 7 deletions
|
@ -1,3 +1,5 @@
|
|||
import logging
|
||||
import pprint
|
||||
import signal
|
||||
|
||||
from prometheus_client import start_http_server
|
||||
|
@ -28,7 +30,10 @@ def get_bridge(accessory_driver: AccessoryDriver, settings: Settings):
|
|||
|
||||
|
||||
if __name__ == "__main__":
|
||||
logging.basicConfig(level="INFO")
|
||||
settings = Settings()
|
||||
logging.info("Running with settings:")
|
||||
logging.info(pprint.pformat(settings.model_dump()))
|
||||
# Start prometheus metrics server. Any metrics will be registered automatically.
|
||||
if settings.prometheus.enabled:
|
||||
start_http_server(settings.prometheus.port)
|
||||
|
|
|
@ -3,7 +3,7 @@ prometheus:
|
|||
port: 8000
|
||||
hap:
|
||||
port: 51826
|
||||
persist_file: /home/pi/bme680-homekit/sensors/accessory.state
|
||||
persist_file: /home/denis/bme680-homekit/sensors/accessory.state
|
||||
bridge:
|
||||
display_name: Bridge
|
||||
bme680:
|
||||
|
|
|
@ -6,12 +6,12 @@ After=network-online.target
|
|||
[Service]
|
||||
Restart=on-failure
|
||||
RestartSec=5s
|
||||
User=pi
|
||||
User=denis
|
||||
Restart=on-failure
|
||||
|
||||
ExecStart=/home/pi/bme680-homekit/prometheus/prometheus-2.36.1.linux-armv6/prometheus \
|
||||
--config.file=/home/pi/bme680-homekit/prometheus/prometheus.yml \
|
||||
--storage.tsdb.path=/home/pi/bme680-homekit/prometheus/data
|
||||
ExecStart=/home/denis/bme680-homekit/prometheus/prometheus-2.36.1.linux-armv6/prometheus \
|
||||
--config.file=/home/denis/bme680-homekit/prometheus/prometheus.yml \
|
||||
--storage.tsdb.path=/home/denis/bme680-homekit/prometheus/data
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
|
@ -3,10 +3,11 @@ Description=Bme680 Homekit service
|
|||
After=local-fs.target network-online.target
|
||||
|
||||
[Service]
|
||||
WorkingDirectory=/home/pi/bme680-homekit/
|
||||
Environment="HOMEKIT_CONFIG=/home/denis/bme680-homekit/config.yaml"
|
||||
WorkingDirectory=/home/denis/bme680-homekit/
|
||||
Restart=on-failure
|
||||
RestartSec=5s
|
||||
User=pi
|
||||
User=denis
|
||||
ExecStart=/usr/bin/python3 -m app.main
|
||||
|
||||
[Install]
|
||||
|
|
Loading…
Reference in a new issue