def test_hue(self): sc = CommandLegacy(0x45, None, 1) self.assertEqual( self.commands.hue(0.0), CommandLegacy(0x40, 0xaa, 1, select=True, select_command=sc)) self.assertEqual( self.commands.hue(0.5), CommandLegacy(0x40, 0x2a, 1, select=True, select_command=sc))
def test_brightness(self): sc = CommandLegacy(0x45, None, 1) self.assertEqual( self.commands.brightness(0.0), CommandLegacy(0x4e, 0x02, 1, select=True, select_command=sc)) self.assertEqual( self.commands.brightness(0.5), CommandLegacy(0x4e, 0x0f, 1, select=True, select_command=sc)) self.assertEqual( self.commands.brightness(1.0), CommandLegacy(0x4e, 0x1b, 1, select=True, select_command=sc))
def test_white(self): sc = CommandLegacy(0x45, None, 1) self.assertEqual( self.commands.white(), CommandLegacy(0xc5, None, 1, select=True, select_command=sc))
def test_off(self): self.assertEqual(self.commands.off(), CommandLegacy(0x46, None, 1))
def test_on(self): self.assertEqual(self.commands.on(), CommandLegacy(0x45, None, 1))
def test_warmer(self): sc = CommandLegacy(0x38, None, 1) self.assertEqual( self.commands.warmer(), CommandLegacy(0x3e, None, 1, select=True, select_command=sc))
def test_brighter(self): sc = CommandLegacy(0x38, None, 1) self.assertEqual( self.commands.brighter(), CommandLegacy(0x3c, None, 1, select=True, select_command=sc))
def test_night_light(self): sc = CommandLegacy(0x46, None, 1) self.assertEqual( self.commands.night_light(), CommandLegacy(0xc6, None, 1, select=True, select_command=sc))