fix(ups_hid): usb initalization

Signed-off-by: bullshit <coding@ow-software.pl>
This commit is contained in:
bullshit committed 2025-08-16 16:42:43 +02:00
1 parent 81ad815ed0
commit ab54e302ef
4 files changed
+1368 -1064

No files matched your search

+7 -1
View File
@@ -7,13 +7,19 @@ from esphome.const import (
DEVICE_CLASS_VOLTAGE,
DEVICE_CLASS_POWER_FACTOR,
DEVICE_CLASS_DURATION,
STATE_CLASS_MEASUREMENT,
UNIT_PERCENT,
UNIT_VOLT,
UNIT_MINUTE,
UNIT_HERTZ,
)
# Handle STATE_CLASS_MEASUREMENT import for different ESPHome versions
try:
from esphome.const import STATE_CLASS_MEASUREMENT
except ImportError:
from esphome.components.sensor import StateClass
STATE_CLASS_MEASUREMENT = StateClass.MEASUREMENT
from . import ups_hid_ns, UpsHidComponent, CONF_UPS_HID_ID
DEPENDENCIES = ["ups_hid"]