From 6931a86430d872da06c6e45afc328094a05bfe93 Mon Sep 17 00:00:00 2001 From: Kev Date: Fri, 16 Aug 2024 20:08:19 +0000 Subject: [PATCH] Fix sensor setup issue --- custom_components/pirateweather/sensor.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/custom_components/pirateweather/sensor.py b/custom_components/pirateweather/sensor.py index 8736b72..cfd34f3 100644 --- a/custom_components/pirateweather/sensor.py +++ b/custom_components/pirateweather/sensor.py @@ -2,7 +2,7 @@ import logging from dataclasses import dataclass, field -from datetime import fromtimestamp +from datetime import datetime from typing import Literal, NamedTuple import homeassistant.helpers.config_validation as cv @@ -1175,7 +1175,7 @@ def get_state(self, data): "sunrise_time", "sunset_time", ]: - outState = fromtimestamp(state) + outState = datetime.fromtimestamp(state) else: outState = state