Skip to content

Commit

Permalink
Fixes issue #4 "compatibility with 2023.5"
Browse files Browse the repository at this point in the history
  • Loading branch information
gcarmix committed May 13, 2023
1 parent 848374f commit 7918cc5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import logging

import voluptuous as vol

from homeassistant.components.rest.data import RestData
from requests.auth import HTTPBasicAuth
from homeassistant.components.sensor import (
Expand Down Expand Up @@ -64,7 +63,10 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info=
_LOGGER.info("method: %s", method)

sig = signature(RestData)
if len(sig.parameters) > 9:
if len(sig.parameters) == 11:
#for compatibility with Home Assistant 2023.5
rest = RestData(hass, method, zcs_address,'utf-8', auth, headers, None, None, verify_ssl, "python_default", timeout)
elif len(sig.parameters) == 10:
#for compatibility with Home Assistant 2023
rest = RestData(hass, method, zcs_address,'utf-8', auth, headers, None, None, verify_ssl, timeout)
else:
Expand Down

0 comments on commit 7918cc5

Please sign in to comment.