aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/test_k1c.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/test_k1c.py b/tests/test_k1c.py
index b82869e..47c25ec 100644
--- a/tests/test_k1c.py
+++ b/tests/test_k1c.py
@@ -80,6 +80,13 @@ class K1C(unittest.TestCase):
m.state(), m.state()
self.assertEqual(sum("/server/files/metadata" in u for u, _ in fake.calls), 1)
+ def test_part_fan_falls_back_to_crealitys_output_pin(self):
+ st = k1c.summarize({"fan": {}, "output_pin fan0": {"value": 0.5}})
+ self.assertEqual(st["fan"], 0.5)
+ # What the K1C actually reports: the key present, the value null.
+ self.assertEqual(k1c.summarize({"fan": {"speed": None}, "output_pin fan0": {"value": 1.0}})["fan"], 1.0)
+ self.assertEqual(k1c.summarize({"fan": {"speed": 0.3}, "output_pin fan0": {"value": 1}})["fan"], 0.3)
+
def test_off_backs_off_instead_of_polling_every_tick(self):
fake = Fake(down=True)
m = k1c.make({"k1c": {"url": URL}, "http": fake})