Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions homeassistant/components/bmp280/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
_LOGGER = logging.getLogger(__name__)

DEFAULT_NAME = "BMP280"
DEFAULT_SCAN_INTERVAL = timedelta(seconds=15)
SCAN_INTERVAL = timedelta(seconds=15)

MIN_TIME_BETWEEN_UPDATES = timedelta(seconds=3)

Expand Down Expand Up @@ -51,13 +51,14 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
# this usually happens when the board is I2C capable, but the device can't be found at the configured address
if str(error.args[0]).startswith("No I2C device at address"):
_LOGGER.error(
"%s. Hint: Check wiring and make sure that the SDO pin is tied to either ground (0x76) or VCC (0x77)!",
"%s. Hint: Check wiring and make sure that the SDO pin is tied to either ground (0x76) or VCC (0x77)",
error.args[0],
)
raise PlatformNotReady()
raise error
_LOGGER.error(error.args[0])
Comment thread
belidzs marked this conversation as resolved.
Outdated
return
# use custom name if there's any
name = config.get(CONF_NAME)
name = config[CONF_NAME]
# BMP280 has both temperature and pressure sensing capability
add_entities(
[Bmp280TemperatureSensor(bmp280, name), Bmp280PressureSensor(bmp280, name)]
Expand Down