26
26
# TODO: NEW -- Add config dialog to rcparams device that's generated
27
27
# automatically?
28
28
# TODO: Support substitutions for certain fields (like save location).
29
- # TODO: Try to molify annotation collisions.
29
+ # TODO: Try to address annotation collisions.
30
30
31
+ # TODO: Iterate CSV engine devices and warn if any are writing to same file.
31
32
# TODO: Wrap long names for battery health device?
32
33
# TODO: Add facility to have different Y1 and Y2. Add a new group of controls
33
34
# (like Y1) for Y2 and then have a control to allow user to elect when Y
34
35
# axis to assign the line to.
35
- # TODO: Iterate CSV engine devices and warn if any are writing to same file.
36
36
# TODO: Remove matplotlib_version.html after deprecation
37
37
# TODO: if the csv save location is a share, and the share is unreachable, it
38
38
# blows up.
54
54
import os
55
55
import traceback
56
56
import unicodedata
57
- import re
58
57
59
58
import matplotlib
60
59
matplotlib .use ('AGG' ) # Note: this statement must be run before any other matplotlib imports are done.
@@ -209,7 +208,7 @@ def closedPrefsConfigUi(self, valuesDict, userCancelled):
209
208
self .logger .warning (u"Verbose logging is on. It is best not to leave this turned on for very long." )
210
209
else :
211
210
self .plugin_file_handler .setLevel (10 )
212
- self .logger .info (u"Verbose logging is off." )
211
+ self .logger .info (u"Verbose logging is off. It is best to leave this turned off unless directed. " )
213
212
214
213
self .logger .threaddebug (u"Configuration complete." )
215
214
@@ -228,7 +227,7 @@ def deviceStartComm(self, dev):
228
227
# If chartLastUpdated is empty, set it to the epoch
229
228
if dev .deviceTypeId != 'csvEngine' and dev .states ['chartLastUpdated' ] == "" :
230
229
dev .updateStateOnServer (key = 'chartLastUpdated' , value = '1970-01-01 00:00:00.000000' )
231
- self .logger .threaddebug (u"CSV last update unknow . Coercing update." )
230
+ self .logger .threaddebug (u"CSV last update unknown . Coercing update." )
232
231
233
232
# If the refresh interval is greater than zero
234
233
# Note that we check for the existence of the device state before trying to
@@ -250,34 +249,6 @@ def deviceStartComm(self, dev):
250
249
dev .stateListOrDisplayStateIdChanged ()
251
250
dev .updateStateImageOnServer (indigo .kStateImageSel .SensorOff )
252
251
253
- # TODO: isolate this function and fold it into the __clean_prefs method.
254
- # =============================================================================
255
- # current_prefs = []
256
- # dead_prefs = []
257
- #
258
- # # Get the device's current Devices.xml config
259
- # config_prefs = self.devicesTypeDict[dev.deviceTypeId]["ConfigUIRawXml"]
260
- # config_prefs = ET.ElementTree(ET.fromstring(config_prefs))
261
- #
262
- # # Iterate the XML to get the field IDs
263
- # for pref in config_prefs.findall('Field'):
264
- # dev_id = unicode(pref.get('id'))
265
- # current_prefs.append(dev_id)
266
- #
267
- # self.logger.info(u"Current config prefs: {0}".format(sorted(current_prefs)))
268
- #
269
- # Get the device's current config. There may be prefs here that are not
270
- # in Devices.xml but are still valid (they may have been added dynamically).
271
- # dev_prefs = dev.pluginProps
272
- # self.logger.info(u"Current device prefs: {0}".format(sorted(dict(dev_prefs).keys())))
273
- #
274
- # # prefs in the device that aren't in the config
275
- # for pref in dev_prefs:
276
- # if pref not in current_prefs:
277
- # dead_prefs.append(pref)
278
- #
279
- # self.logger.info(u"Device prefs not in current config: {0}".format(sorted(dead_prefs)))
280
-
281
252
# =============================================================================
282
253
def deviceStopComm (self , dev ):
283
254
0 commit comments