Skip to content

Commit

Permalink
Updates
Browse files Browse the repository at this point in the history
  • Loading branch information
jinglemansweep committed Nov 6, 2023
1 parent d07ccb0 commit b6982d1
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions wideboy/scenes/default/tiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,9 @@ def process(self, state):
value = state.get("sensor.octopus_energy_electricity_current_demand", 0)
self.visible = value > 0
self.label = f"{value:.0f}w"
self.icon_color = (
Color(255, 64, 64, 255) if value > 500 else Color(64, 255, 64, 255)
)


class TileElectricityCurrentRate(HomeAssistantEntityTile):
Expand All @@ -149,6 +152,9 @@ def process(self, state: dict[str, Any]):
value = state.get("sensor.octopus_energy_electricity_current_rate", 0)
self.visible = value > 0
self.label = f"£{value:.2f}"
self.icon_color = (
Color(255, 64, 64, 255) if value > 0.30 else Color(64, 255, 64, 255)
)


class TileElectricityHourlyRate(HomeAssistantEntityTile):
Expand All @@ -159,6 +165,9 @@ def process(self, state):
value = state.get("sensor.electricity_hourly_rate", 0)
self.visible = value > 0
self.label = f"{value:.2f}"
self.icon_color = (
Color(255, 64, 64, 255) if value > 0.50 else Color(64, 255, 64, 255)
)


class TileElectricityCurrentAccumulativeCost(HomeAssistantEntityTile):
Expand All @@ -171,6 +180,9 @@ def process(self, state):
)
self.visible = value > 0
self.label = f"{value:.2f}"
self.icon_color = (
Color(255, 64, 64, 255) if value > 2.50 else Color(64, 255, 64, 255)
)


# BATTERY
Expand All @@ -184,6 +196,9 @@ def process(self, state):
value = state.get("sensor.delta_2_max_downstairs_battery_level", 0)
self.visible = value > 0
self.label = f"{value:.0f}%"
self.icon_color = (
Color(255, 64, 64, 255) if value < 30 else Color(64, 255, 64, 255)
)


class TileBatteryCycles(HomeAssistantEntityTile):
Expand Down

0 comments on commit b6982d1

Please sign in to comment.