Skip to content

Commit

Permalink
Use MONOTONIC_TIME direct from bluetooth component (fixes 2024.1) (#79)
Browse files Browse the repository at this point in the history
* Update __init__.py

monotonic_time_coarse changed location and faster

* Import MONOTONIC_TIME directly from bluetooth component

Uses bdraco's faster implementation per jaymunro's PR and should remain backwards-compatible.

---------

Co-authored-by: Ashley Gittins <[email protected]>
  • Loading branch information
jaymunro and agittins authored Jan 4, 2024
1 parent 75ea006 commit 89790fe
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions custom_components/bermuda/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
from homeassistant.components.bluetooth import BluetoothChange
from homeassistant.components.bluetooth import BluetoothScannerDevice
from homeassistant.components.bluetooth import BluetoothServiceInfoBleak
from homeassistant.components.bluetooth import MONOTONIC_TIME
from homeassistant.components.bluetooth.active_update_coordinator import (
PassiveBluetoothDataUpdateCoordinator,
)
Expand All @@ -34,7 +35,6 @@
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator
from homeassistant.util import slugify
from homeassistant.util.dt import get_age
from homeassistant.util.dt import monotonic_time_coarse
from homeassistant.util.dt import now

from .const import ADVERT_FRESHTIME
Expand All @@ -60,8 +60,6 @@

SCAN_INTERVAL = timedelta(seconds=5)

MONOTONIC_TIME: Final = monotonic_time_coarse

CONFIG_SCHEMA = cv.config_entry_only_config_schema(DOMAIN)

_LOGGER: logging.Logger = logging.getLogger(__package__)
Expand Down

0 comments on commit 89790fe

Please sign in to comment.