Use constant for default medium type in Mopeka (#125002)

- Updated the Mopeka BLE device setup to use const
  DEFAULT_MEDIUM_TYPE
- Fix Spelling error in a coment
This commit is contained in:
Bill Flood 2024-08-31 22:12:24 -07:00 committed by GitHub
parent 30772da0e1
commit 95a25c72dc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -14,7 +14,7 @@ from homeassistant.config_entries import ConfigEntry
from homeassistant.const import Platform
from homeassistant.core import HomeAssistant
from .const import CONF_MEDIUM_TYPE
from .const import CONF_MEDIUM_TYPE, DEFAULT_MEDIUM_TYPE
PLATFORMS: list[Platform] = [Platform.SENSOR]
@ -29,8 +29,8 @@ async def async_setup_entry(hass: HomeAssistant, entry: MopekaConfigEntry) -> bo
address = entry.unique_id
assert address is not None
# Default sensors configured prior to the intorudction of MediumType
medium_type_str = entry.data.get(CONF_MEDIUM_TYPE, MediumType.PROPANE.value)
# Default sensors configured prior to the introduction of MediumType
medium_type_str = entry.data.get(CONF_MEDIUM_TYPE, DEFAULT_MEDIUM_TYPE)
data = MopekaIOTBluetoothDeviceData(MediumType(medium_type_str))
coordinator = entry.runtime_data = PassiveBluetoothProcessorCoordinator(
hass,