Beispiel #1
0
def setup_platform(hass, config, add_entities, discovery_info=None):
    """Set up Piko inverter."""
    from pikopy.piko import Piko

    piko = Piko(config[CONF_HOST],
                config[CONF_USERNAME],
                config[CONF_PASSWORD])

    dev = []
    for sensor in config[CONF_MONITORED_CONDITIONS]:
        dev.append(PikoInverter(piko, sensor))

    add_entities(dev)
Beispiel #2
0
 def test_get_l3_power(self):
     p = Piko(host='http://example.com')
     self.assertEqual(p.get_l3_power(), 0)
Beispiel #3
0
 def test_get_string3_current(self):
     p = Piko(host='http://example.com')
     self.assertEqual(p.get_string3_current(), 0.0)
Beispiel #4
0
 def test_get_l3_voltage(self):
     p = Piko(host='http://example.com')
     self.assertEqual(p.get_l3_voltage(), 230)
Beispiel #5
0
 def test_get_string1_voltage(self):
     p = Piko(host='http://example.com')
     self.assertEqual(p.get_string1_voltage(), 384)
Beispiel #6
0
 def test_get_daily_energy(self):
     p = Piko(host='http://example.com')
     self.assertEqual(p.get_daily_energy(), 19.83)
Beispiel #7
0
 def test_get_total_energy(self):
     p = Piko(host='http://example.com')
     self.assertEqual(p.get_total_energy(), 9290)
Beispiel #8
0
 def test_get_current_power(self):
     p = Piko(host='http://example.com')
     self.assertEqual(p.get_current_power(), 112)
Beispiel #9
0
 def test_get_raw_content(self):
     p = Piko(host='http://example.com')
     self.assertEqual(p._get_raw_content(),
                      ['112', '9290', '19.83', '384', '230', '0.20', '0', '278', '232', '0.21', '112', '0', '230',
                       '0.00', '0'])