Skip to content

Commit

Permalink
Unlimited inputs (#106)
Browse files Browse the repository at this point in the history
* Standardise input sensor/meter handelling to permitt unlimited meters

* Bug fixes

* Add discharge only option

* Add battery configuration options

* Update the confid directly instead of using options

* Format with black

* Adjust wording of config_flow

* Try to fix config flow bug

---------

Co-authored-by: Hamish Findlay <hif2k1>
  • Loading branch information
hif2k1 authored Dec 6, 2023
1 parent 3784c73 commit 6d47cc1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions custom_components/battery_sim/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ async def async_meter_menu(self, user_input=None):
export_meter = True
if import_meter and export_meter:
menu_options.append("all_done")
return self.async_show_menu(step_id="meterMenu", menu_options=menu_options)
return self.async_show_menu(step_id="meter_menu", menu_options=menu_options)

async def async_step_add_import_meter(self, user_input=None):
if user_input is not None:
Expand Down Expand Up @@ -154,7 +154,7 @@ async def async_step_add_export_meter(self, user_input=None):

async def async_tariff_menu(self, user_input=None):
return self.async_show_menu(
step_id="tariffMenu",
step_id="tariff_menu",
menu_options=["no_tariff_info", "fixed_tariff", "tariff_sensor"],
)

Expand Down
4 changes: 2 additions & 2 deletions custom_components/battery_sim/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
},
"description": "Set the speciffications of the battery. Please consider posting details of the battery you are simulating on our github so we can add it to the template list."
},
"meterMenu": {
"meter_menu": {
"title": "Add Meters",
"menu_options": {
"add_import_meter": "Add import meter (measuring energy coming into home from the grid)",
Expand All @@ -35,7 +35,7 @@
},
"description": "At least one import and one export meter are required. Meters monitoring solar generation direcly shouldn't be added."
},
"tariffMenu": {
"tariff_menu": {
"title": "Select Tariff Type",
"menu_options": {
"no_tariff_info": "No tariff for this meter",
Expand Down

0 comments on commit 6d47cc1

Please sign in to comment.