mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 12:17:07 +00:00
Set parallel-updates and scan-interval explicitly in onewire (#134953)
This commit is contained in:
parent
30695cfef5
commit
901099325b
@ -3,6 +3,7 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
|
from datetime import timedelta
|
||||||
import os
|
import os
|
||||||
|
|
||||||
from homeassistant.components.binary_sensor import (
|
from homeassistant.components.binary_sensor import (
|
||||||
@ -19,6 +20,9 @@ from .const import DEVICE_KEYS_0_3, DEVICE_KEYS_0_7, DEVICE_KEYS_A_B, READ_MODE_
|
|||||||
from .entity import OneWireEntity, OneWireEntityDescription
|
from .entity import OneWireEntity, OneWireEntityDescription
|
||||||
from .onewirehub import OneWireHub
|
from .onewirehub import OneWireHub
|
||||||
|
|
||||||
|
PARALLEL_UPDATES = 0
|
||||||
|
SCAN_INTERVAL = timedelta(seconds=30)
|
||||||
|
|
||||||
|
|
||||||
@dataclass(frozen=True)
|
@dataclass(frozen=True)
|
||||||
class OneWireBinarySensorEntityDescription(
|
class OneWireBinarySensorEntityDescription(
|
||||||
|
@ -4,6 +4,7 @@ from __future__ import annotations
|
|||||||
|
|
||||||
from collections.abc import Callable, Mapping
|
from collections.abc import Callable, Mapping
|
||||||
import dataclasses
|
import dataclasses
|
||||||
|
from datetime import timedelta
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
from types import MappingProxyType
|
from types import MappingProxyType
|
||||||
@ -41,6 +42,9 @@ from .const import (
|
|||||||
from .entity import OneWireEntity, OneWireEntityDescription
|
from .entity import OneWireEntity, OneWireEntityDescription
|
||||||
from .onewirehub import OneWireHub
|
from .onewirehub import OneWireHub
|
||||||
|
|
||||||
|
PARALLEL_UPDATES = 0
|
||||||
|
SCAN_INTERVAL = timedelta(seconds=30)
|
||||||
|
|
||||||
|
|
||||||
@dataclasses.dataclass(frozen=True)
|
@dataclasses.dataclass(frozen=True)
|
||||||
class OneWireSensorEntityDescription(OneWireEntityDescription, SensorEntityDescription):
|
class OneWireSensorEntityDescription(OneWireEntityDescription, SensorEntityDescription):
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
|
from datetime import timedelta
|
||||||
import os
|
import os
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
@ -16,6 +17,9 @@ from .const import DEVICE_KEYS_0_3, DEVICE_KEYS_0_7, DEVICE_KEYS_A_B, READ_MODE_
|
|||||||
from .entity import OneWireEntity, OneWireEntityDescription
|
from .entity import OneWireEntity, OneWireEntityDescription
|
||||||
from .onewirehub import OneWireHub
|
from .onewirehub import OneWireHub
|
||||||
|
|
||||||
|
PARALLEL_UPDATES = 0
|
||||||
|
SCAN_INTERVAL = timedelta(seconds=30)
|
||||||
|
|
||||||
|
|
||||||
@dataclass(frozen=True)
|
@dataclass(frozen=True)
|
||||||
class OneWireSwitchEntityDescription(OneWireEntityDescription, SwitchEntityDescription):
|
class OneWireSwitchEntityDescription(OneWireEntityDescription, SwitchEntityDescription):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user