From 554645409713381036317a58f6eae15257748ab8 Mon Sep 17 00:00:00 2001 From: Marc Billow Date: Sat, 4 Jul 2026 16:17:44 -0500 Subject: [PATCH] fix: remove ocf/state_cache.py's stale mqtt_demo-descriptor type dependency --- ocf/state_cache.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/ocf/state_cache.py b/ocf/state_cache.py index a8e7ee0..7aa19fa 100644 --- a/ocf/state_cache.py +++ b/ocf/state_cache.py @@ -8,15 +8,16 @@ from __future__ import annotations import threading import time -from typing import Callable, Optional, TYPE_CHECKING +from typing import Callable, Optional, Protocol -if TYPE_CHECKING: - from .appliances.base import ApplianceDescriptor + +class _ObservationHook(Protocol): + def on_observation(self, state: dict, href: str, rep: dict) -> None: ... class StateCache: - def __init__(self, descriptor: 'ApplianceDescriptor'): + def __init__(self, descriptor: '_ObservationHook'): self.descriptor = descriptor self.links: dict[str, dict] = {} self.last_updated: dict[str, float] = {}