mirror of
https://github.com/esphome/esphome.git
synced 2025-11-18 07:45:56 +00:00
BME280 SPI (#5538)
* bme spi finally * linter * CO * tidy * lint * tidy [2] * tidy[-1] * final solution * Update test1.yaml remove failed test * Update test1.1.yaml add test to another file with free GPIO5 pin * fix spi read bytes * fix tests * rename bme280 to bme280_i2c
This commit is contained in:
19
esphome/components/bme280_i2c/sensor.py
Normal file
19
esphome/components/bme280_i2c/sensor.py
Normal file
@@ -0,0 +1,19 @@
|
||||
import esphome.codegen as cg
|
||||
from esphome.components import i2c
|
||||
from ..bme280_base.sensor import to_code as to_code_base, cv, CONFIG_SCHEMA_BASE
|
||||
|
||||
DEPENDENCIES = ["i2c"]
|
||||
AUTO_LOAD = ["bme280_base"]
|
||||
|
||||
bme280_ns = cg.esphome_ns.namespace("bme280_i2c")
|
||||
BME280I2CComponent = bme280_ns.class_(
|
||||
"BME280I2CComponent", cg.PollingComponent, i2c.I2CDevice
|
||||
)
|
||||
|
||||
CONFIG_SCHEMA = CONFIG_SCHEMA_BASE.extend(
|
||||
i2c.i2c_device_schema(default_address=0x77)
|
||||
).extend({cv.GenerateID(): cv.declare_id(BME280I2CComponent)})
|
||||
|
||||
|
||||
async def to_code(config):
|
||||
await to_code_base(config, func=i2c.register_i2c_device)
|
||||
Reference in New Issue
Block a user