def test_parse(self):
        tahoma = Protocol("", "", unittest=1 )
        tahoma._getSetup(SetupInput) # only for unit tests

        self.assertEqual(tahoma.location["postalCode"], "90210")
        self.assertTrue(tahoma.gateway[0]["alive"])
        self.assertEqual(tahoma.gateway[0]["connectivity"]["protocolVersion"], "8")
        self.assertEqual(len(tahoma.getDevices()), 6)
        device = tahoma.getDevice("hue://1234-1234-1234/123456789012/lights/1")
        self.assertEqual(device.activeStates["core:CieColorSpaceYState"], 0.2792)
    def test_parse(self):
        tahoma = Protocol("", "", unittest=1)
        tahoma._getSetup(SetupInput)  # only for unit tests

        self.assertEqual(tahoma.location["postalCode"], "90210")
        self.assertTrue(tahoma.gateway[0]["alive"])
        self.assertEqual(tahoma.gateway[0]["connectivity"]["protocolVersion"],
                         "8")
        self.assertEqual(len(tahoma.getDevices()), 6)
        device = tahoma.getDevice("hue://1234-1234-1234/123456789012/lights/1")
        self.assertEqual(device.activeStates["core:CieColorSpaceYState"],
                         0.2792)
예제 #3
0
 def test_getStates(self):
     tahoma = Protocol(_USER, _PW)
     tahoma.getSetup()
     self.assertTrue( len(tahoma.getDevices()) > 0)
     tahoma.getStates(None)
예제 #4
0
 def test_getStates(self):
     tahoma = Protocol(_USER, _PW)
     tahoma.getSetup()
     self.assertTrue(len(tahoma.getDevices()) > 0)
     tahoma.getStates(None)