Skip to content

Commit

Permalink
fix(sensor): updated tariff code in sensor setup to be retrieved afte…
Browse files Browse the repository at this point in the history
…r it's been setup in the rate coordinator
  • Loading branch information
BottlecapDave committed Dec 23, 2021
1 parent 6001882 commit 9caade9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions custom_components/octopus_energy/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,10 @@ async def async_setup_default_sensors(hass, entry, async_add_entities):
client = hass.data[DOMAIN][DATA_CLIENT]

rate_coordinator = hass.data[DOMAIN][DATA_COORDINATOR]

tariff_code = hass.data[DOMAIN][DATA_TARIFF_CODE]

await rate_coordinator.async_config_entry_first_refresh()

tariff_code = hass.data[DOMAIN][DATA_TARIFF_CODE]

entities = [OctopusEnergyElectricityCurrentRate(rate_coordinator), OctopusEnergyElectricityPreviousRate(rate_coordinator)]

Expand Down

0 comments on commit 9caade9

Please sign in to comment.