Skip to content

Commit

Permalink
support 2021.11
Browse files Browse the repository at this point in the history
  • Loading branch information
dgomes committed Nov 6, 2021
1 parent 7319a5f commit 2d83134
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
20 changes: 10 additions & 10 deletions custom_components/erse/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,11 @@ async def async_step_utility_meter(self, user_input=None):
data_schema=vol.Schema(
{
vol.Optional(CONF_UTILITY_METERS): cv.multi_select(
[
s.entity_id
{
s.entity_id: s.name
for s in self.hass.states.async_all()
if s.domain == UTILITY_METER_DOMAIN
]
}
),
}
),
Expand All @@ -109,23 +109,23 @@ async def async_step_costs(self, user_input=None):
if user_input is None:
DATA_SCHEMA = vol.Schema(
{
vol.Required(CONF_POWER_COST): float,
vol.Required(CONF_POWER_COST): vol.Coerce(float),
**{
vol.Required(tariff.name): float
vol.Required(tariff.name): vol.Coerce(float)
for tariff in self.operator.plano.tarifas
},
**{
vol.Required(tariff.name + CONF_METER_SUFFIX): cv.multi_select(
[
s.entity_id
{
s.entity_id: s.name
for s in self.hass.states.async_all()
if s.domain == SENSOR_DOMAIN
and s.attributes.get(ATTR_UNIT_OF_MEASUREMENT)
in [
ENERGY_WATT_HOUR,
ENERGY_KILO_WATT_HOUR,
]
]
}
)
for tariff in self.operator.plano.tarifas
},
Expand Down Expand Up @@ -184,11 +184,11 @@ async def async_step_init(self, user_input=None):
{
vol.Required(
CONF_POWER_COST, default=self.costs[CONF_POWER_COST]
): float,
): vol.Coerce(float),
**{
vol.Required(
tariff.name, default=self.costs[tariff.name]
): float
): vol.Coerce(float)
for tariff in self.operator.plano.tarifas
},
}
Expand Down
2 changes: 1 addition & 1 deletion custom_components/erse/manifest.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "2.1.1",
"version": "2.1.2",
"domain": "erse",
"name": "Entidade Reguladora dos Servi\u00e7os Energ\u00e9ticos",
"config_flow": true,
Expand Down
2 changes: 1 addition & 1 deletion hacs.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Entidade Reguladora dos Serviços Energéticos",
"country": "PT",
"homeassistant": "2021.9.0",
"homeassistant": "2021.11.0",
"render_readme": true
}

0 comments on commit 2d83134

Please sign in to comment.