class TestLegacyCommands(unittest.TestCase): def setUp(self): self.commands = CommandSetLegacy(1, 10) def test_convert_brightness(self): self.assertEqual(self.commands.convert_brightness(0), 2) self.assertEqual(self.commands.convert_brightness(0.5), 7) self.assertEqual(self.commands.convert_brightness(1.0), 12) def test_convert_hue(self): self.assertEqual(CommandSetLegacy.convert_hue(0), 170) self.assertEqual(CommandSetLegacy.convert_hue(0.5), 42) self.assertEqual(CommandSetLegacy.convert_hue(1.0), 170)
class TestLegacyCommands(unittest.TestCase): def setUp(self): bridge = Bridge('localhost', 9999, version=5) self.commands = CommandSetLegacy(bridge, 1, 10) def test_convert_brightness(self): self.assertEqual(self.commands.convert_brightness(0), 2) self.assertEqual(self.commands.convert_brightness(0.5), 7) self.assertEqual(self.commands.convert_brightness(1.0), 12) def test_convert_hue(self): self.assertEqual(CommandSetLegacy.convert_hue(0), 170) self.assertEqual(CommandSetLegacy.convert_hue(0.5), 42) self.assertEqual(CommandSetLegacy.convert_hue(1.0), 170)
def setUp(self): self.commands = CommandSetLegacy(1, 10)
def test_convert_hue(self): self.assertEqual(CommandSetLegacy.convert_hue(0), 170) self.assertEqual(CommandSetLegacy.convert_hue(0.5), 42) self.assertEqual(CommandSetLegacy.convert_hue(1.0), 170)
def setUp(self): bridge = Bridge('localhost', 9999, version=5) self.commands = CommandSetLegacy(bridge, 1, 10)