Added pickle_to_class.py for converting pickled tags to class instances
This commit is contained in:
10
POCloud_Driver/pickle_to_class.py
Normal file
10
POCloud_Driver/pickle_to_class.py
Normal file
@@ -0,0 +1,10 @@
|
||||
import pickle
|
||||
with open("ipp_channels.p", 'rb') as picklefile:
|
||||
channels = pickle.load(picklefile)
|
||||
|
||||
for chname in sorted(channels):
|
||||
ch = channels[chname]
|
||||
if ch['data_type'] == "BOOL":
|
||||
print("'{0}': Channel('{0}', '{1}', {2}, self.sendtodbJSON, writeable=True, e300_param=False),".format(chname, ch['tag'], ch['max_time_between_uploads']))
|
||||
else:
|
||||
print("'{0}': Channel('{0}', '{1}', {2}, self.sendtodbJSON, writeable=True, change_threshold=1.0, e300_param=False),".format(chname, ch['tag'], ch['max_time_between_uploads']))
|
||||
Reference in New Issue
Block a user