Exemple #1
0
 def test_set_vals(self, rp):
     pdp = proliphix.PDP(mock.sentinel.host, mock.sentinel.user,
                         mock.sentinel.passwd)
     pdp.setback_heat = 69.1
     rp.assert_called_once_with("http://%s/pdp" % mock.sentinel.host,
                                auth=(mock.sentinel.user,
                                      mock.sentinel.passwd),
                                data='OID4.1.5=691&submit=Submit')
Exemple #2
0
def setup_platform(hass, config, add_entities, discovery_info=None):
    """Set up the Proliphix thermostats."""
    username = config.get(CONF_USERNAME)
    password = config.get(CONF_PASSWORD)
    host = config.get(CONF_HOST)

    pdp = proliphix.PDP(host, username, password)

    add_entities([ProliphixThermostat(pdp)], True)
Exemple #3
0
 def test_update(self, rp, cd):
     pdp = proliphix.PDP(mock.sentinel.host, mock.sentinel.user,
                         mock.sentinel.passwd)
     pdp.update()
     rp.assert_called_once_with(
         "http://%s/get" % mock.sentinel.host,
         auth=(mock.sentinel.user, mock.sentinel.passwd),
         data=('OID1.10.9=&OID1.2=&OID2.5.1=&OID2.7.1=&OID4.1.1=&OID4.1.11='
               '&OID4.1.13=&OID4.1.14='
               '&OID4.1.2=&OID4.1.4=&OID4.1.5='
               '&OID4.1.6=&OID4.5.1=&OID4.5.3=&OID4.5.5=&OID4.5.6='))
Exemple #4
0
def setup_platform(
    hass: HomeAssistant,
    config: ConfigType,
    add_entities: AddEntitiesCallback,
    discovery_info: DiscoveryInfoType | None = None,
) -> None:
    """Set up the Proliphix thermostats."""
    username = config.get(CONF_USERNAME)
    password = config.get(CONF_PASSWORD)
    host = config.get(CONF_HOST)

    pdp = proliphix.PDP(host, username, password)
    pdp.update()

    add_entities([ProliphixThermostat(pdp)], True)