1
0
Fork 0

자동검색 추가

This commit is contained in:
Sangbum Kim 2017-10-22 18:33:48 +09:00
parent 27f5c49aec
commit 8e0beec40f
1 changed files with 4 additions and 3 deletions

View File

@ -1,11 +1,12 @@
from miio.airpurifier import AirPurifier, OperationMode, LedBrightness
from miio.discovery import create_device
from collections import namedtuple
from datetime import datetime
import time
from influxdb import InfluxDBClient
import json
from systemd import daemon
import socket
class Message(namedtuple('Message', ('measurement', 'time', 'tags', 'fields'))):
__slots__ = ()
@ -34,8 +35,8 @@ if __name__ == '__main__':
try:
metric = InfluxDBClient('db', database='core',
use_udp=True, udp_port=8089)
dev = AirPurifier('air', '6e1e05b87d9f7cd10a3f8f43616896fa')
air_addr=socket.gethostbyname("air")
dev = create_device(air_addr,AirPurifier)
tags = {
'source': 'mi_air_2',
'position': 'center_room',