Skip to content

Commit 7bdb4b4

Browse files
Ruff formatting
1 parent 8978d8b commit 7bdb4b4

2 files changed

Lines changed: 36 additions & 30 deletions

File tree

custom_components/periodic_min_max/config_flow.py

Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -22,28 +22,32 @@
2222
_STATISTIC_MEASURES = ["min", "max"]
2323

2424

25-
OPTIONS_SCHEMA = vol.Schema({
26-
vol.Required(CONF_ENTITY_ID): selector.EntitySelector(
27-
selector.EntitySelectorConfig(
28-
domain=[SENSOR_DOMAIN, NUMBER_DOMAIN, INPUT_NUMBER_DOMAIN],
29-
multiple=False,
25+
OPTIONS_SCHEMA = vol.Schema(
26+
{
27+
vol.Required(CONF_ENTITY_ID): selector.EntitySelector(
28+
selector.EntitySelectorConfig(
29+
domain=[SENSOR_DOMAIN, NUMBER_DOMAIN, INPUT_NUMBER_DOMAIN],
30+
multiple=False,
31+
),
3032
),
31-
),
32-
vol.Required(CONF_TYPE): selector.SelectSelector(
33-
selector.SelectSelectorConfig(
34-
options=_STATISTIC_MEASURES, translation_key=CONF_TYPE
33+
vol.Required(CONF_TYPE): selector.SelectSelector(
34+
selector.SelectSelectorConfig(
35+
options=_STATISTIC_MEASURES, translation_key=CONF_TYPE
36+
),
3537
),
36-
),
37-
vol.Required(CONF_EQUAL_UPDATES, default=False): selector.BooleanSelector(),
38-
})
39-
40-
CONFIG_SCHEMA = vol.Schema({
41-
vol.Required("name"): selector.TextSelector(
42-
selector.TextSelectorConfig(
43-
type=selector.TextSelectorType.TEXT, autocomplete="off"
44-
),
45-
)
46-
}).extend(OPTIONS_SCHEMA.schema)
38+
vol.Required(CONF_EQUAL_UPDATES, default=False): selector.BooleanSelector(),
39+
}
40+
)
41+
42+
CONFIG_SCHEMA = vol.Schema(
43+
{
44+
vol.Required("name"): selector.TextSelector(
45+
selector.TextSelectorConfig(
46+
type=selector.TextSelectorType.TEXT, autocomplete="off"
47+
),
48+
)
49+
}
50+
).extend(OPTIONS_SCHEMA.schema)
4751

4852
CONFIG_FLOW = {
4953
"user": SchemaFlowFormStep(CONFIG_SCHEMA),

custom_components/periodic_min_max/sensor.py

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -129,16 +129,18 @@ async def async_registry_updated(
129129
config_entry.add_update_listener(config_entry_update_listener)
130130
)
131131

132-
async_add_entities([
133-
PeriodicMinMaxSensor(
134-
hass,
135-
source_entity_id,
136-
config_entry.title,
137-
sensor_type,
138-
equal_updates,
139-
config_entry.entry_id,
140-
)
141-
])
132+
async_add_entities(
133+
[
134+
PeriodicMinMaxSensor(
135+
hass,
136+
source_entity_id,
137+
config_entry.title,
138+
sensor_type,
139+
equal_updates,
140+
config_entry.entry_id,
141+
)
142+
]
143+
)
142144

143145
return True
144146

0 commit comments

Comments
 (0)