Skip to content

Commit

Permalink
Run formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed May 6, 2023
1 parent a9df8ad commit 6891d26
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
3 changes: 2 additions & 1 deletion custom_components/powercalc/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -693,7 +693,8 @@ async def check_entity_not_already_configured(

entity_id = source_entity.entity_id
if unique_id is None and (
entity_id in discovered_entities.keys() or entity_id in configured_entities.keys()
entity_id in discovered_entities.keys()
or entity_id in configured_entities.keys()
):
raise SensorAlreadyConfiguredError(source_entity.entity_id, existing_entities)

Expand Down
9 changes: 6 additions & 3 deletions custom_components/powercalc/sensors/power.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,9 @@ async def create_virtual_power_sensor(
entity_id = generate_power_sensor_entity_id(
hass, sensor_config, source_entity, unique_id=unique_id
)
entity_category: str | None = sensor_config.get(CONF_POWER_SENSOR_CATEGORY) or None
entity_category: str | None = (
sensor_config.get(CONF_POWER_SENSOR_CATEGORY) or None
)

strategy = select_calculation_strategy(sensor_config, power_profile)

Expand Down Expand Up @@ -216,7 +218,8 @@ async def create_virtual_power_sensor(
standby_power_on=standby_power_on,
update_frequency=sensor_config.get(CONF_FORCE_UPDATE_FREQUENCY), # type: ignore
multiply_factor=sensor_config.get(CONF_MULTIPLY_FACTOR),
multiply_factor_standby=sensor_config.get(CONF_MULTIPLY_FACTOR_STANDBY) or False,
multiply_factor_standby=sensor_config.get(CONF_MULTIPLY_FACTOR_STANDBY)
or False,
ignore_unavailable_state=sensor_config.get(CONF_IGNORE_UNAVAILABLE_STATE)
or False,
rounding_digits=sensor_config.get(CONF_POWER_SENSOR_PRECISION), # type: ignore
Expand All @@ -243,7 +246,7 @@ async def create_real_power_sensor(
return RealPowerSensor(
entity_id=power_sensor_id, # type: ignore
device_id=device_id,
unique_id=unique_id
unique_id=unique_id,
)


Expand Down

0 comments on commit 6891d26

Please sign in to comment.