Skip to content

Commit 0bce9c6

Browse files
committed
Fixes bug in Area, Bar, Line, and Scatter Chart devices where ticking
the Suppress [item] checkbox did not silence the warnings that the [item] color is the same as the plot area color.
1 parent 7fa6806 commit 0bce9c6

File tree

3 files changed

+14
-17
lines changed

3 files changed

+14
-17
lines changed

_changelog.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
v0.8.27
2+
- Fixes bug in Area, Bar, Line, and Scatter Chart devices where ticking the
3+
Suppress [item] checkbox did not silence the warnings that the [item] color
4+
is the same as the plot area color.
5+
16
v0.8.26
27
- Version sync
38

matplotlib.indigoPlugin/Contents/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<plist version="1.0">
44
<dict>
55
<key>PluginVersion</key>
6-
<string>0.8.26</string>
6+
<string>0.8.27</string>
77
<key>ServerApiVersion</key>
88
<string>2.0</string>
99
<key>IwsApiVersion</key>

matplotlib.indigoPlugin/Contents/Server Plugin/plugin.py

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,6 @@
5050
# day's forecast high temperature. ('%%d:733695023:d01_temperatureHigh%%', 'blue'). Note
5151
# that this is non-trivial because it requires a round-trip outside the class. Needs a
5252
# pipe to send things to the host plugin and get a response.
53-
# TODO: we use `dev.pluginProps.get() which likely involves a round trip to the server. Can we load
54-
# the props once per refresh to speed things up?
5553
# ================================== IMPORTS ==================================
5654

5755
try:
@@ -101,7 +99,7 @@
10199
__license__ = Dave.__license__
102100
__build__ = Dave.__build__
103101
__title__ = "Matplotlib Plugin for Indigo Home Control"
104-
__version__ = "0.8.26"
102+
__version__ = "0.8.27"
105103

106104
# =============================================================================
107105

@@ -571,8 +569,6 @@ def shutdown(self):
571569
# =============================================================================
572570
def validatePrefsConfigUi(self, values_dict=None):
573571

574-
changed_keys = ()
575-
config_changed = False
576572
error_msg_dict = indigo.Dict()
577573

578574
self.debug_level = int(values_dict['showDebugLevel'])
@@ -649,6 +645,9 @@ def validatePrefsConfigUi(self, values_dict=None):
649645
# TODO: consider adding this feature to DLFramework and including in all plugins.
650646
# ============================== Log All Changes ==============================
651647
# Log any changes to the plugin preferences.
648+
changed_keys = ()
649+
config_changed = False
650+
652651
for key in values_dict.keys():
653652
try:
654653
if values_dict[key] != self.pluginPrefs[key]:
@@ -1096,10 +1095,6 @@ def audit_csv_health(self):
10961095
for thing in column_dict.items():
10971096
full_path = data_path + thing[1][0] + ".csv"
10981097

1099-
# TODO: does it make sense to combine this with the check that happens at CSV device refresh?
1100-
# could do passed device or if no passed device do all devices. Note that they are
1101-
# constructed slightly differently now.
1102-
11031098
# ============================= Create (if needed) ============================
11041099
# If the appropriate CSV file doesn't exist, create it and write the header
11051100
# line.
@@ -1146,8 +1141,6 @@ def audit_device_props(self):
11461141
:return:
11471142
"""
11481143
# TODO: migrate this to DLFramework
1149-
# TODO: add facility to compare current value to available values (i.e., a
1150-
# control value is no longer an available option.)
11511144

11521145
import xml.etree.ElementTree as eTree
11531146

@@ -3149,7 +3142,7 @@ def chart_area(self, dev, p_dict, k_dict, return_queue):
31493142
p_dict['area{0}MarkerColor'.format(area)] = r"#{0}".format(p_dict['area{0}MarkerColor'.format(area)].replace(' ', '').replace('#', ''))
31503143

31513144
# If area color is the same as the background color, alert the user.
3152-
if p_dict['area{0}Color'.format(area)] == p_dict['backgroundColor']:
3145+
if p_dict['area{0}Color'.format(area)] == p_dict['backgroundColor'] and not suppress_area:
31533146
log['Warning'].append(u"[{0}] Area {1} color is the same as the background color (so you may not be able to see it).".format(dev.name, area))
31543147

31553148
# If the area is suppressed, remind the user they suppressed it.
@@ -3374,7 +3367,7 @@ def chart_bar(self, dev, p_dict, k_dict, return_queue):
33743367
p_dict['bar{0}Color'.format(thing)] = r"#{0}".format(p_dict['bar{0}Color'.format(thing)].replace(' ', '').replace('#', ''))
33753368

33763369
# If the bar color is the same as the background color, alert the user.
3377-
if p_dict['bar{0}Color'.format(thing)] == p_dict['backgroundColor']:
3370+
if p_dict['bar{0}Color'.format(thing)] == p_dict['backgroundColor'] and not suppress_bar:
33783371
log['Info'].append(u"[{0}] Bar {1} color is the same as the background color (so you may not be able to see it).".format(dev.name, thing))
33793372

33803373
# If the bar is suppressed, remind the user they suppressed it.
@@ -3794,7 +3787,7 @@ def chart_line(self, dev, p_dict, k_dict, return_queue):
37943787
p_dict['line{0}BestFitColor'.format(line)] = r"#{0}".format(p_dict['line{0}BestFitColor'.format(line)].replace(' ', '').replace('#', ''))
37953788

37963789
# If line color is the same as the background color, alert the user.
3797-
if p_dict['line{0}Color'.format(line)] == p_dict['backgroundColor']:
3790+
if p_dict['line{0}Color'.format(line)] == p_dict['backgroundColor'] and not suppress_line:
37983791
log['Warning'].append(u"[{0}] Line {1} color is the same as the background color (so you may not be able to see it).".format(dev.name, line))
37993792

38003793
# If the line is suppressed, remind the user they suppressed it.
@@ -4263,7 +4256,7 @@ def chart_scatter(self, dev, p_dict, k_dict, return_queue):
42634256
p_dict['line{0}BestFitColor'.format(thing)] = r"#{0}".format(p_dict['line{0}BestFitColor'.format(thing)].replace(' ', '').replace('#', 'FF 00 00'))
42644257

42654258
# If dot color is the same as the background color, alert the user.
4266-
if p_dict['group{0}Color'.format(thing)] == p_dict['backgroundColor']:
4259+
if p_dict['group{0}Color'.format(thing)] == p_dict['backgroundColor'] and not suppress_group:
42674260
log['Debug'].append(u"[{0}] Group {1} color is the same as the background color (so you may not be able to see it).".format(dev.name, thing))
42684261

42694262
# If the group is suppressed, remind the user they suppressed it.
@@ -4412,7 +4405,6 @@ def chart_weather_composite(self, dev, dev_type, p_dict, k_dict, state_list, ret
44124405
-----
44134406
44144407
"""
4415-
# TODO: Make a collapsible section to set min/max Y ranges for each distinct range [temp, humidity, pressure, wind, precip]
44164408
dpi = int(plt.rcParams['savefig.dpi'])
44174409
forecast_length = {'Daily': 8, 'Hourly': 24, 'wundergroundTenDay': 10, 'wundergroundHourly': 24}
44184410
height = int(dev.pluginProps['height'])

0 commit comments

Comments
 (0)