Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
magnuselden authored and magnuselden committed Apr 17, 2024
1 parent b00340e commit d330b7d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions peaqevcore/common/spotprice/energidataservice.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ async def async_set_dto(self, ret, initial: bool = False) -> None:
def setup(self):
try:
sensor_entity = self.custom_sensor if self.custom_sensor else ENERGIDATASERVICE_SENSOR
if self.custom_sensor:
_LOGGER.info(f"Using custom sensor for spot-prices: {self.custom_sensor}")
sensor = self.state_machine.states.get(sensor_entity)
if not sensor.state:
self.hub.options.price.price_aware = False # todo: composition
Expand Down
2 changes: 2 additions & 0 deletions peaqevcore/common/spotprice/nordpool.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ def setup(self):
f"There were no Spotprice-entities. Cannot continue. with price-awareness."
)
if len(list(entities)) == 1 or self.custom_sensor:
if self.custom_sensor:
_LOGGER.info(f"Using custom sensor for spot-prices: {self.custom_sensor}")
self._setup_set_entity(self.custom_sensor if self.custom_sensor else list(entities)[0])
else:
_found: bool = False
Expand Down

0 comments on commit d330b7d

Please sign in to comment.