Skip to content

Commit 181513c

Browse files
author
James Boulton
committed
fix tests
1 parent 9e2b182 commit 181513c

File tree

7 files changed

+13
-13
lines changed

7 files changed

+13
-13
lines changed

dashio/iotcontrol/control.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ def __init__(self, ctrl_type: str, control_id: str):
409409
'3': []
410410
}
411411

412-
self._is_active = False
412+
self._is_active = True
413413

414414
self._cfg_max_no_columns = 3
415415
self.ctrl_type = ctrl_type.translate(BAD_CHARS)

dashio/iotcontrol/direction.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ def __init__(
119119
Units to be displayed with the value, by default ""
120120
precision : Precision, optional
121121
Precision of the value displayed, by default Precision.OFF
122-
calibration_angle : int, optional
122+
calibration_angle : float, optional
123123
Calibration angle offset, by default 0
124124
column_no : int, optional default is 1. Must be 1..3
125125
The Dash App reports its screen size in columns. column_no allows you to specify which column no to load into.

tests/test_dial.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,12 @@ def test_dial_show_min_max(self):
3838
def test_dial_dial_fill_color(self):
3939
test_control = Dial("DIALID", dial_fill_color=Color.WHEAT)
4040
cfg_dict = self._get_cfg_dict(test_control.get_cfg(["DEVICEID", "CONTROLID", "DASHID", 1]))
41-
self.assertEqual(cfg_dict['dialFillColor'], '110', "CFG dialFillColor should be '110'")
41+
self.assertEqual(cfg_dict['dialFillColor'], '111', "CFG dialFillColor should be '111'")
4242

4343
def test_dial_pointer_color(self):
4444
test_control = Dial("DIALID", pointer_color=Color.AZURE)
4545
cfg_dict = self._get_cfg_dict(test_control.get_cfg(["DEVICEID", "CONTROLID", "DASHID", 1]))
46-
self.assertEqual(cfg_dict['pointerColor'], '136', "CFG pointerColor should be '136'")
46+
self.assertEqual(cfg_dict['pointerColor'], '137', "CFG pointerColor should be '137'")
4747

4848
def test_dial_number_position(self):
4949
test_control = Dial("DIALID", number_position=DialNumberPosition.LEFT)

tests/test_direction.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def test_direction_direction_value(self):
1919
def test_direction_direction_text(self):
2020
test_control = Direction("DIRECTIONID")
2121
test_control.direction_text = 'THAT WAY'
22-
self.assertEqual(test_control.get_state(), '\t{device_id}\tDIR\tDIRECTIONID\t0\tTHAT WAY\n', "Should be 1")
22+
self.assertEqual(test_control.get_state(), '\t{device_id}\tDIR\tDIRECTIONID\t0\tTHAT WAY\n', "Should be THAT WAY")
2323

2424
def test_direction_pointer_color(self):
2525
test_control = Direction("DIRECTIONID", pointer_color=Color.BLUE)

tests/test_knob.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import unittest
33

44
from dashio import Knob
5-
from dashio.iotcontrol.enums import Color
5+
from dashio.iotcontrol.enums import Color, DialMode
66

77

88
class TestKnob(unittest.TestCase):
@@ -46,9 +46,9 @@ def test_knob_cfg_send_only_on_release(self):
4646
self.assertEqual(cfg_dict['sendOnlyOnRelease'], True, "CFG sendOnlyOnRelease should be True")
4747

4848
def test_knob_cfg_dial_follows_knob(self):
49-
test_control = Knob("KNOBID", dial_follows_knob=True)
49+
test_control = Knob("KNOBID", dial_mode=DialMode.FOLLOW)
5050
cfg_dict = self._get_cfg_dict(test_control.get_cfg(["DEVICEID", "CONTROLID", "DASHID", 1]))
51-
self.assertEqual(cfg_dict['dialFollowsKnob'], True, "CFG dialFollowsKnob should be True")
51+
self.assertEqual(cfg_dict['dialMode'], 'FOLLOW', "CFG dial_mode should be FOLLOW")
5252

5353
def test_knob_cfg_dial_color(self):
5454
test_control = Knob("KNOBID", dial_color=Color.AQUA)

tests/test_slider.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import unittest
33

44
from dashio import Slider
5-
from dashio.iotcontrol.enums import Color, SliderBarStyle
5+
from dashio.iotcontrol.enums import Color, SliderBarStyle, BarMode
66

77

88
def _get_cfg_dict(cfg_list: list):
@@ -53,9 +53,9 @@ def test_slider_single_bar_cfg_send_only_on_release(self):
5353
self.assertEqual(cfg_dict['sendOnlyOnRelease'], True, "CFG sendOnlyOnRelease should be True")
5454

5555
def test_slider_single_bar_cfg_bar_follows_slider(self):
56-
test_control = Slider("SLIDERID", bar_follows_slider=True)
56+
test_control = Slider("SLIDERID", bar_mode=BarMode.FOLLOW)
5757
cfg_dict = _get_cfg_dict(test_control.get_cfg(["DEVICEID", "CONTROLID", "DASHID", 1]))
58-
self.assertEqual(cfg_dict['barFollowsSlider'], True, "CFG barFollowsSlider should be True")
58+
self.assertEqual(cfg_dict['barMode'], 'FOLLOW', "CFG barFollowsSlider should be True")
5959

6060
def test_slider_single_bar_cfg_bar_color(self):
6161
test_control = Slider("SLIDERID", bar_color=Color.CHARTREUSE)

tests/test_textbox.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ def test_text_box_cfg_text_align(self):
3333
self.assertEqual(TextAlignment(cfg_dict['textAlign']), TextAlignment.CENTER, "CFG textAlign should be CENTER")
3434

3535
def test_text_box_cfg_text_format(self):
36-
test_control = TextBox("TEXTBOXID", text_format=TextFormat.NUMBER)
36+
test_control = TextBox("TEXTBOXID", text_format=TextFormat.NUM)
3737
cfg_dict = _get_cfg_dict(test_control.get_cfg(["DEVICEID", "CONTROLID", "DASHID", 1]))
38-
self.assertEqual(TextFormat(cfg_dict['format']), TextFormat.NUMBER, "CFG format should be CENTER")
38+
self.assertEqual(TextFormat(cfg_dict['format']), TextFormat.NUM, "CFG format should be CENTER")
3939

4040
def test_text_box_cfg_units(self):
4141
test_control = TextBox("TEXTBOXID", units='Amps')

0 commit comments

Comments
 (0)