Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
cereal2nd committed Nov 5, 2024
1 parent a0e2cdf commit ab88f5a
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion tests/channels_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@


def test_channel_set_name_char():
channel = Channel(None, None, "placeholder", False, None, None)
channel = Channel(None, None, "placeholder", False, False, None, None)
name = "FooBar"
for pos in range(0, 16):
if pos < len(name):
Expand Down
8 changes: 5 additions & 3 deletions tests/module_status_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,12 @@ async def test_module_status_selected_program(module_type):

# load the module with dummy channels
for chan in range(1, 9):
m._channels[chan] = Channel(None, None, None, False, None, None)
m._channels[CHANNEL_LIGHT_VALUE] = LightSensor(None, None, None, False, None, None)
m._channels[chan] = Channel(None, None, None, False, False, None, None)
m._channels[CHANNEL_LIGHT_VALUE] = LightSensor(
None, None, None, False, False, None, None
)
m._channels[CHANNEL_SELECTED_PROGRAM] = SelectedProgram(
m, None, None, False, velbus.send, None
m, None, None, False, False, velbus.send, None
)

messages_to_test = [
Expand Down
4 changes: 2 additions & 2 deletions tests/temperature_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ async def test_temperature_same_precision(
temperature_profile: typing.List[float],
precision: float,
):
ch = Temperature(None, None, None, False, None, None)
ch = Temperature(None, None, None, False, True, None, None)
for temp in temperature_profile:
temp_truncated_to_precision = math.floor(temp / precision) * precision
await ch.maybe_update_temperature(temp_truncated_to_precision, precision)
Expand All @@ -37,7 +37,7 @@ async def test_temperature_same_precision(
async def test_temperature_alternating_precision(
temperature_profile: typing.List[float],
):
ch = Temperature(None, None, None, False, None, None)
ch = Temperature(None, None, None, False, True, None, None)
for temp in temperature_profile:
for precision in [1 / 2, 1 / 64]:
temp_truncated_to_precision = math.floor(temp / precision) * precision
Expand Down
2 changes: 1 addition & 1 deletion tests/thermostat_operating_mode_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ async def test_thermostat_operating_mode(mode, sleep_timer):
await m.initialize(velbus.send)
m._log = logging.getLogger("velbus-module")
chan = m._translate_channel_name(m._data["TemperatureChannel"])
m._channels[chan] = Temperature(m, chan, None, False, velbus.send, None)
m._channels[chan] = Temperature(m, chan, None, False, False, velbus.send, None)

msg = TempSensorStatusMessage(module_address)
msg.status_str = DSTATUS[mode]
Expand Down

0 comments on commit ab88f5a

Please sign in to comment.