-
-
Notifications
You must be signed in to change notification settings - Fork 110
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #302 from petretiandrea/refactor/minor-improvement…
…s-and-setup refactor: setup and minor improvements
- Loading branch information
Showing
17 changed files
with
367 additions
and
359 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,16 @@ | ||
from homeassistant.config_entries import ConfigEntry | ||
from homeassistant.core import HomeAssistant | ||
from custom_components.tapo.common_setup import TapoCoordinator | ||
|
||
from custom_components.tapo.common_setup import TapoUpdateCoordinator | ||
from custom_components.tapo.tapo_sensor_entity import ( | ||
TapoOverheatSensor, | ||
) | ||
from custom_components.tapo.const import ( | ||
DOMAIN, | ||
) | ||
from custom_components.tapo.sensor import TapoSensor | ||
from custom_components.tapo.sensors import OverheatSensorSource | ||
|
||
|
||
async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry, async_add_devices): | ||
# get tapo helper | ||
coordinator: TapoUpdateCoordinator = hass.data[DOMAIN][entry.entry_id] | ||
sensors = [TapoOverheatSensor(coordinator)] | ||
coordinator: TapoCoordinator = hass.data[DOMAIN][entry.entry_id] | ||
sensors = [TapoSensor(coordinator, OverheatSensorSource())] | ||
async_add_devices(sensors, True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.