Skip to content

Commit

Permalink
fix syntax warning
Browse files Browse the repository at this point in the history
  • Loading branch information
InTheDaylight14 committed Nov 13, 2024
1 parent c718325 commit 2006040
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions custom_components/npm_switches/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,13 +177,13 @@ async def enable_host(self, host_id: str, host_type: str) -> None:
response = await self.api_wrapper("post", url, headers=self._headers)

if response is True:
if host_type is "proxy-hosts":
if host_type == "proxy-hosts":
self.proxy_hosts_data[host_id]["enabled"] = 1
if host_type is "redirection-hosts":
if host_type == "redirection-hosts":
self.redir_hosts_data[host_id]["enabled"] = 1
if host_type is "streams":
if host_type == "streams":
self.stream_hosts_data[host_id]["enabled"] = 1
if host_type is "dead-hosts":
if host_type == "dead-hosts":
self.dead_hosts_data[host_id]["enabled"] = 1
elif "error" in response.keys():
_LOGGER.error(
Expand All @@ -200,13 +200,13 @@ async def disable_host(self, host_id: str, host_type: str) -> None:

response = await self.api_wrapper("post", url, headers=self._headers)
if response is True:
if host_type is "proxy-hosts":
if host_type == "proxy-hosts":
self.proxy_hosts_data[host_id]["enabled"] = 0
if host_type is "redirection-hosts":
if host_type == "redirection-hosts":
self.redir_hosts_data[host_id]["enabled"] = 0
if host_type is "streams":
if host_type == "streams":
self.stream_hosts_data[host_id]["enabled"] = 0
if host_type is "dead-hosts":
if host_type == "dead-hosts":
self.dead_hosts_data[host_id]["enabled"] = 0
elif "error" in response.keys():
_LOGGER.error(
Expand Down

0 comments on commit 2006040

Please sign in to comment.