esphome/esphome/components/mopeka_ble/__init__.py
Sean Brogan 1d2e0f74ea
Add Mopeka BLE and Mopeka Pro Check BLE Sensor (#2618)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2022-03-01 11:30:33 +13:00

23 lines
652 B
Python

import esphome.codegen as cg
import esphome.config_validation as cv
from esphome.components import esp32_ble_tracker
from esphome.const import CONF_ID
CODEOWNERS = ["@spbrogan"]
DEPENDENCIES = ["esp32_ble_tracker"]
mopeka_ble_ns = cg.esphome_ns.namespace("mopeka_ble")
MopekaListener = mopeka_ble_ns.class_(
"MopekaListener", esp32_ble_tracker.ESPBTDeviceListener
)
CONFIG_SCHEMA = cv.Schema(
{
cv.GenerateID(): cv.declare_id(MopekaListener),
}
).extend(esp32_ble_tracker.ESP_BLE_DEVICE_SCHEMA)
async def to_code(config):
var = cg.new_Pvariable(config[CONF_ID])
await esp32_ble_tracker.register_ble_device(var, config)