Exemplo n.º 1
0
 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))
Exemplo n.º 2
0
 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))
Exemplo n.º 3
0
 def test_white(self):
     sc = CommandLegacy(0x45, None, 1)
     self.assertEqual(
         self.commands.white(),
         CommandLegacy(0xc5, None, 1, select=True, select_command=sc))
Exemplo n.º 4
0
 def test_off(self):
     self.assertEqual(self.commands.off(), CommandLegacy(0x46, None, 1))
Exemplo n.º 5
0
 def test_on(self):
     self.assertEqual(self.commands.on(), CommandLegacy(0x45, None, 1))
Exemplo n.º 6
0
 def test_warmer(self):
     sc = CommandLegacy(0x38, None, 1)
     self.assertEqual(
         self.commands.warmer(),
         CommandLegacy(0x3e, None, 1, select=True, select_command=sc))
Exemplo n.º 7
0
 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))