Skip to content

Commit

Permalink
Merge pull request #164 from Snuffy2/Update-get-and-post
Browse files Browse the repository at this point in the history
Update get and post to handle response status
  • Loading branch information
alexdelprete authored Sep 7, 2024
2 parents 9e96026 + e077ab6 commit 08168d5
Show file tree
Hide file tree
Showing 4 changed files with 110 additions and 149 deletions.
2 changes: 1 addition & 1 deletion custom_components/opnsense/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
SHOULD_RELOAD,
UNDO_UPDATE_LISTENER,
)
from .pyopnsense import Client as OPNSenseClient
from .pyopnsense import OPNSenseClient
from .services import ServiceRegistrar

_LOGGER = logging.getLogger(__name__)
Expand Down
8 changes: 5 additions & 3 deletions custom_components/opnsense/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
DEFAULT_VERIFY_SSL,
DOMAIN,
)
from .pyopnsense import Client
from .pyopnsense import OPNSenseClient

_LOGGER = logging.getLogger(__name__)

Expand Down Expand Up @@ -76,7 +76,9 @@ async def async_step_user(self, user_input=None):
password = user_input[CONF_PASSWORD]
verify_ssl = user_input.get(CONF_VERIFY_SSL, DEFAULT_VERIFY_SSL)

client = Client(url, username, password, {"verify_ssl": verify_ssl})
client = OPNSenseClient(
url, username, password, {"verify_ssl": verify_ssl}
)
system_info = await self.hass.async_add_executor_job(
client.get_system_info
)
Expand Down Expand Up @@ -235,7 +237,7 @@ async def async_step_device_tracker(self, user_input=None):
username = self.config_entry.data.get(CONF_USERNAME, DEFAULT_USERNAME)
password = self.config_entry.data[CONF_PASSWORD]
verify_ssl = self.config_entry.data.get(CONF_VERIFY_SSL, DEFAULT_VERIFY_SSL)
client = Client(url, username, password, {"verify_ssl": verify_ssl})
client = OPNSenseClient(url, username, password, {"verify_ssl": verify_ssl})
if user_input is None and (
arp_table := await self.hass.async_add_executor_job(
client.get_arp_table, True
Expand Down
Loading

0 comments on commit 08168d5

Please sign in to comment.