From 2d224dbc2222d2344f5fc3d175a4e283df7dbc64 Mon Sep 17 00:00:00 2001 From: Jeef Date: Sat, 27 Jan 2024 21:07:22 -0700 Subject: [PATCH] removed timezone --- pyproject.toml | 2 +- src/intellifire4py/cloud_api.py | 10 +++++----- src/intellifire4py/local_api.py | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 7cc4680..82506a5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "intellifire4py" -version = "4.1.6" +version = "4.1.7" description = "Intellifire4Py" authors = ["Jeff Stein "] license = "MIT" diff --git a/src/intellifire4py/cloud_api.py b/src/intellifire4py/cloud_api.py index de2890c..f4b08f0 100644 --- a/src/intellifire4py/cloud_api.py +++ b/src/intellifire4py/cloud_api.py @@ -2,7 +2,7 @@ from __future__ import annotations import time import asyncio -from datetime import datetime, timezone +from datetime import datetime from asyncio import Task from typing import Any @@ -150,7 +150,7 @@ async def _send_cloud_command( 422 Invalid Parameter (invalid command id or command value) """ if response.status == 204: - self.last_send = datetime.now(timezone.utc) + self.last_send = datetime.now() return # elif ( # response.status == 403 @@ -200,11 +200,11 @@ async def long_poll(self, fireplace: IntelliFireFireplaceCloud) -> bool: self._log.debug("Long Poll Status Code %d", response.status) if response.status == 200: self._log.debug("Long poll: 200 - Received data") - self.last_long_poll = datetime.now(timezone.utc) + self.last_long_poll = datetime.now() return True elif response.status == 408: self._log.debug("Long poll: 408 - No Data changed") - self.last_long_poll = datetime.now(timezone.utc) + self.last_long_poll = datetime.now() return False elif response.status == 403: raise CloudError("Not authorized") @@ -278,7 +278,7 @@ async def poll(self, timeout_seconds: float = 10.0) -> None: self._data = IntelliFirePollData(**json_data) self._log.debug(f"poll() complete: {self._data}") - self.last_poll = datetime.now(timezone.utc) + self.last_poll = datetime.now() except aiohttp.ClientResponseError as e: if e.status == 403: diff --git a/src/intellifire4py/local_api.py b/src/intellifire4py/local_api.py index 3427749..323ff38 100644 --- a/src/intellifire4py/local_api.py +++ b/src/intellifire4py/local_api.py @@ -21,7 +21,7 @@ from .utils import _range_check import aiohttp -from datetime import datetime, timezone +from datetime import datetime class IntelliFireAPILocal(IntelliFireController, IntelliFireDataProvider): @@ -205,7 +205,7 @@ async def poll( json_data = await response.json(content_type=None) self._data = IntelliFirePollData(**json_data) self._log.debug(f"poll() complete: {self._data}") - self.last_poll = datetime.now(timezone.utc) + self.last_poll = datetime.now() except JSONDecodeError as error: if not suppress_warnings: self._log.warning("Error decoding JSON: [%s]", response.text) @@ -339,7 +339,7 @@ async def _send_local_command( self._log.debug( "_send_local_command:: Response Code [%d]", resp.status ) - self.last_send = datetime.now(timezone.utc) + self.last_send = datetime.now() except asyncio.TimeoutError as error: self._log.warning("Control Endpoint Timeout Error %s", error) continue