Skip to content

Commit

Permalink
fix: Updated previous/current/next event rate sensors to not be disab…
Browse files Browse the repository at this point in the history
…led by default
  • Loading branch information
BottlecapDave committed Nov 21, 2023
1 parent 1ff0ce9 commit e10c6dd
Show file tree
Hide file tree
Showing 8 changed files with 6 additions and 54 deletions.
6 changes: 3 additions & 3 deletions _docs/entities/electricity.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ This is in pounds and pence (e.g. 1.01 = £1.01).

`event.octopus_energy_electricity_{{METER_SERIAL_NUMBER}}_{{MPAN_NUMBER}}_current_day_rates`

The state of this sensor states when the current day's rates were last updated. The attributes of this sensor exposes the current day's rates. This is [disabled by default](../faq.md#there-are-entities-that-are-disabled-why-are-they-disabled-and-how-do-i-enable-them).
The state of this sensor states when the current day's rates were last updated. The attributes of this sensor exposes the current day's rates.

| Attribute | Type | Description |
|-----------|------|-------------|
Expand All @@ -118,7 +118,7 @@ Each rate item has the following attributes

`event.octopus_energy_electricity_{{METER_SERIAL_NUMBER}}_{{MPAN_NUMBER}}_previous_day_rates`

The state of this sensor states when the previous day's rates were last updated. The attributes of this sensor exposes the previous day's rates. This is [disabled by default](../faq.md#there-are-entities-that-are-disabled-why-are-they-disabled-and-how-do-i-enable-them).
The state of this sensor states when the previous day's rates were last updated. The attributes of this sensor exposes the previous day's rates.

| Attribute | Type | Description |
|-----------|------|-------------|
Expand All @@ -140,7 +140,7 @@ Each rate item has the following attributes

`event.octopus_energy_electricity_{{METER_SERIAL_NUMBER}}_{{MPAN_NUMBER}}_next_day_rates`

The state of this sensor states when the next day's rates were last updated. The attributes of this sensor exposes the next day's rates. This is [disabled by default](../faq.md#there-are-entities-that-are-disabled-why-are-they-disabled-and-how-do-i-enable-them).
The state of this sensor states when the next day's rates were last updated. The attributes of this sensor exposes the next day's rates.

| Attribute | Type | Description |
|-----------|------|-------------|
Expand Down
6 changes: 3 additions & 3 deletions _docs/entities/gas.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ The next/upcoming rate that energy consumption will be charged at (including VAT

`event.octopus_energy_gas_{{METER_SERIAL_NUMBER}}_{{MPRN_NUMBER}}_current_day_rates`

The state of this sensor states when the current day's rates were last updated. The attributes of this sensor exposes the current day's rates. This is [disabled by default](../faq.md#there-are-entities-that-are-disabled-why-are-they-disabled-and-how-do-i-enable-them).
The state of this sensor states when the current day's rates were last updated. The attributes of this sensor exposes the current day's rates.

| Attribute | Type | Description |
|-----------|------|-------------|
Expand All @@ -93,7 +93,7 @@ Each rate item has the following attributes

`event.octopus_energy_gas_{{METER_SERIAL_NUMBER}}_{{MPRN_NUMBER}}_previous_day_rates`

The state of this sensor states when the previous day's rates were last updated. The attributes of this sensor exposes the previous day's rates. This is [disabled by default](../faq.md#there-are-entities-that-are-disabled-why-are-they-disabled-and-how-do-i-enable-them).
The state of this sensor states when the previous day's rates were last updated. The attributes of this sensor exposes the previous day's rates.

| Attribute | Type | Description |
|-----------|------|-------------|
Expand All @@ -113,7 +113,7 @@ Each rate item has the following attributes

`event.octopus_energy_gas_{{METER_SERIAL_NUMBER}}_{{MPRN_NUMBER}}_next_day_rates`

The state of this sensor states when the next day's rates were last updated. The attributes of this sensor exposes the next day's rates. This is [disabled by default](../faq.md#there-are-entities-that-are-disabled-why-are-they-disabled-and-how-do-i-enable-them).
The state of this sensor states when the next day's rates were last updated. The attributes of this sensor exposes the next day's rates.

| Attribute | Type | Description |
|-----------|------|-------------|
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,6 @@ def unique_id(self):
def name(self):
"""Name of the sensor."""
return f"Electricity {self._serial_number} {self._mpan}{self._export_name_addition} Current Day Rates"

@property
def entity_registry_enabled_default(self) -> bool:
"""Return if the entity should be enabled when first added.
This only applies when fist added to the entity registry.
"""
return False

async def async_added_to_hass(self):
"""Call when entity about to be added to hass."""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,6 @@ def name(self):
"""Name of the sensor."""
return f"Electricity {self._serial_number} {self._mpan}{self._export_name_addition} Next Day Rates"

@property
def entity_registry_enabled_default(self) -> bool:
"""Return if the entity should be enabled when first added.
This only applies when fist added to the entity registry.
"""
return False

async def async_added_to_hass(self):
"""Call when entity about to be added to hass."""
# If not None, we got an initial value.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,6 @@ def unique_id(self):
def name(self):
"""Name of the sensor."""
return f"Electricity {self._serial_number} {self._mpan}{self._export_name_addition} Previous Day Rates"

@property
def entity_registry_enabled_default(self) -> bool:
"""Return if the entity should be enabled when first added.
This only applies when fist added to the entity registry.
"""
return False

async def async_added_to_hass(self):
"""Call when entity about to be added to hass."""
Expand Down
8 changes: 0 additions & 8 deletions custom_components/octopus_energy/gas/rates_current_day.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,6 @@ def unique_id(self):
def name(self):
"""Name of the sensor."""
return f"Gas {self._serial_number} {self._mprn} Current Day Rates"

@property
def entity_registry_enabled_default(self) -> bool:
"""Return if the entity should be enabled when first added.
This only applies when fist added to the entity registry.
"""
return False

async def async_added_to_hass(self):
"""Call when entity about to be added to hass."""
Expand Down
8 changes: 0 additions & 8 deletions custom_components/octopus_energy/gas/rates_next_day.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,6 @@ def unique_id(self):
def name(self):
"""Name of the sensor."""
return f"Gas {self._serial_number} {self._mprn} Next Day Rates"

@property
def entity_registry_enabled_default(self) -> bool:
"""Return if the entity should be enabled when first added.
This only applies when fist added to the entity registry.
"""
return False

async def async_added_to_hass(self):
"""Call when entity about to be added to hass."""
Expand Down
8 changes: 0 additions & 8 deletions custom_components/octopus_energy/gas/rates_previous_day.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,6 @@ def unique_id(self):
def name(self):
"""Name of the sensor."""
return f"Gas {self._serial_number} {self._mprn} Previous Day Rates"

@property
def entity_registry_enabled_default(self) -> bool:
"""Return if the entity should be enabled when first added.
This only applies when fist added to the entity registry.
"""
return False

async def async_added_to_hass(self):
"""Call when entity about to be added to hass."""
Expand Down

0 comments on commit e10c6dd

Please sign in to comment.