category field in device
This commit is contained in:
parent
c3a7c19d33
commit
7c68e78ea5
@ -8,13 +8,13 @@ Created on 11.06.2015
|
||||
'''
|
||||
|
||||
import MeterbusTypeConversion
|
||||
|
||||
from MeterbusLibExceptions import *
|
||||
import struct
|
||||
|
||||
class Device(object):
|
||||
def __init__(self, address, comment, dataItems):
|
||||
def __init__(self, address, category, comment, dataItems):
|
||||
self.address = address
|
||||
self.category = category
|
||||
self.comment = comment
|
||||
self.dataItems = dataItems
|
||||
|
||||
@ -417,9 +417,9 @@ class LongFrame(ControlFrame):
|
||||
device = d
|
||||
break
|
||||
if device is not None:
|
||||
self.comment = device.comment
|
||||
self.comment, self.category = device.comment, device.category
|
||||
else:
|
||||
self.comment = '-'
|
||||
self.comment, self.category = '-', '-'
|
||||
self.dib = []
|
||||
consumed = 0
|
||||
dibIndex = 0
|
||||
@ -445,7 +445,7 @@ class LongFrame(ControlFrame):
|
||||
|
||||
def getJSON(self):
|
||||
superJSON = super(LongFrame, self).getJSON()
|
||||
j = {'comment': self.comment, 'header': self.fixedDataHeader.getJSON(), 'dib': [dib.getJSON() for dib in self.dib]}
|
||||
j = {'comment': self.comment, 'category': self.category, 'header': self.fixedDataHeader.getJSON(), 'dib': [dib.getJSON() for dib in self.dib]}
|
||||
j.update(superJSON)
|
||||
return j
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user