Added Price info

This commit is contained in:
2018-09-08 13:14:36 -07:00
parent 507abb4b11
commit cf9789d7d7
8 changed files with 35 additions and 20 deletions

View File

@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
#===========================================================================
#
@@ -17,9 +17,9 @@ messages.
"""
import argparse
import bottle as B
import sys
import json
import bottle as B
import tHome as T
#===========================================================================
@@ -41,6 +41,15 @@ def instant( client, data, cfg ):
return ( cfg.mqttPower, msg )
#===========================================================================
def price( client, data, cfg ):
msg = {
"time" : data.TimeUnix,
"price" : data.Price,
"tier" : data.Tier,
}
return ( cfg.mqttPrice, msg )
#===========================================================================
handlers = {
#"BlockPriceDetail" :
@@ -51,7 +60,7 @@ handlers = {
#"MessageCluster" :
#"MeterInfo" :
#"NetworkInfo" :
#"PriceCluster" :
"PriceCluster" : price,
#"Reading" :
#"ScheduleInfo" :
#"TimeCluster" :