Skip to content

Commit

Permalink
#124 and bump 1.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
magnuselden authored and magnuselden committed Jun 23, 2022
1 parent 24400b1 commit 67ad348
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
5 changes: 4 additions & 1 deletion custom_components/peaqev/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,10 @@ async def servicehandler_disable(call): # pylint:disable=unused-argument

ATTR_HOURS = "hours"
async def servicehandler_override_nonhours(call): # pylint:disable=unused-argument
hours = call.data.get(ATTR_HOURS)
try:
hours = call.data.get(ATTR_HOURS)
except:
hours = 1
await hub.call_override_nonhours(hours)

hass.services.async_register(DOMAIN, "enable", servicehandler_enable)
Expand Down
2 changes: 1 addition & 1 deletion custom_components/peaqev/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"codeowners": [
"@elden1337"
],
"version": "1.2.0",
"version": "1.2.1",
"iot_class": "calculated",
"dependencies": [
"recorder",
Expand Down
2 changes: 1 addition & 1 deletion custom_components/peaqev/peaqservice/hub/hub.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def is_initialized(self) -> bool:
@property
def current_peak_dynamic(self):
if self.price_aware is True and len(self.hours.dynamic_caution_hours):
if datetime.now().hour in self.hours.dynamic_caution_hours.keys():
if datetime.now().hour in self.hours.dynamic_caution_hours.keys() and self.timer.is_override is False:
return self.currentpeak.value * self.hours.dynamic_caution_hours[datetime.now().hour]
return self.currentpeak.value

Expand Down
2 changes: 1 addition & 1 deletion custom_components/peaqev/peaqservice/hub/hub_lite.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def is_initialized(self) -> bool:
@property
def current_peak_dynamic(self):
if self.price_aware is True and len(self.hours.dynamic_caution_hours):
if datetime.now().hour in self.hours.dynamic_caution_hours.keys():
if datetime.now().hour in self.hours.dynamic_caution_hours.keys() and self.timer.is_override is False:
return self.currentpeak.value * self.hours.dynamic_caution_hours[datetime.now().hour]
return self.currentpeak.value

Expand Down

0 comments on commit 67ad348

Please sign in to comment.