mirror of
https://github.com/house-of-vanity/lywsd03mmc_exporter.git
synced 2025-07-07 07:14:09 +00:00
Update bt_exporter.py
This commit is contained in:
@ -1,11 +1,7 @@
|
||||
"""Xiaomi Mi Temperature and Humidity Monitor 2 (LYWSD03MMC) prom exporter"""
|
||||
|
||||
import os
|
||||
import time
|
||||
import requests
|
||||
import binascii
|
||||
import argparse
|
||||
from time import sleep
|
||||
from prometheus_client import start_http_server, Gauge, Enum
|
||||
from bluepy import btle
|
||||
|
||||
@ -58,6 +54,7 @@ class AppMetrics:
|
||||
finally:
|
||||
p.disconnect()
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(
|
||||
description="Xiaomi Mi Temperature and Humidity Monitor 2 (LYWSD03MMC) prom exporter")
|
||||
@ -90,5 +87,6 @@ def main():
|
||||
start_http_server(exporter_port)
|
||||
app_metrics.run_metrics_loop()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
Reference in New Issue
Block a user