Update remaining i2c sensors to use async_add_executor_job (#41860)

This commit is contained in:
J. Nick Koston authored and GitHub committed 2020-10-15 09:22:17 -05:00
1 parent 086378c48f
commit 2e05592039
4 files changed
+10 -10

No files matched your search

+2 -2
View File
@@ -111,7 +111,7 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info=
SENSOR_TYPES[SENSOR_TEMP][1] = hass.config.units.temperature_unit
name = config[CONF_NAME]
sensor_handler = await hass.async_add_job(_setup_bme680, config)
sensor_handler = await hass.async_add_executor_job(_setup_bme680, config)
if sensor_handler is None:
return
@@ -347,7 +347,7 @@ class BME680Sensor(Entity):
async def async_update(self):
"""Get the latest data from the BME680 and update the states."""
await self.hass.async_add_job(self.bme680_client.update)
await self.hass.async_add_executor_job(self.bme680_client.update)
if self.type == SENSOR_TEMP:
temperature = round(self.bme680_client.sensor_data.temperature, 1)
if self.temp_unit == TEMP_FAHRENHEIT: