From 200604018b1ecec85b4ed1a764563303c750e0bc Mon Sep 17 00:00:00 2001 From: MillerKyle72 Date: Wed, 13 Nov 2024 23:53:13 +0000 Subject: [PATCH] fix syntax warning --- custom_components/npm_switches/api.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/custom_components/npm_switches/api.py b/custom_components/npm_switches/api.py index 42eff51..71d3cc9 100644 --- a/custom_components/npm_switches/api.py +++ b/custom_components/npm_switches/api.py @@ -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( @@ -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(