Skip to content

Commit

Permalink
fix: set default client_id ownerapi (#896)
Browse files Browse the repository at this point in the history
closes #895
  • Loading branch information
llamafilm authored Mar 12, 2024
1 parent 100ae1e commit 6d1a3ec
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion custom_components/tesla_custom/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ async def validate_input(hass: core.HomeAssistant, data) -> dict:
config[CONF_INCLUDE_ENERGYSITES] = data[CONF_INCLUDE_ENERGYSITES]
config[CONF_API_PROXY_URL] = data.get(CONF_API_PROXY_URL)
config[CONF_API_PROXY_CERT] = data.get(CONF_API_PROXY_CERT)
config[CONF_CLIENT_ID] = data.get(CONF_CLIENT_ID)
config[CONF_CLIENT_ID] = data.get(CONF_CLIENT_ID, "ownerapi")

except IncompleteCredentials as ex:
_LOGGER.error("Authentication error: %s %s", ex.message, ex)
Expand Down
4 changes: 2 additions & 2 deletions tests/test_config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ async def test_form(hass):
"initial_setup": True,
CONF_API_PROXY_URL: None,
CONF_API_PROXY_CERT: None,
CONF_CLIENT_ID: None,
CONF_CLIENT_ID: "ownerapi",
}
assert len(mock_setup.mock_calls) == 1
assert len(mock_setup_entry.mock_calls) == 1
Expand Down Expand Up @@ -344,7 +344,7 @@ async def test_import(hass):
CONF_API_PROXY_ENABLE: False,
CONF_API_PROXY_CERT: None,
CONF_API_PROXY_URL: None,
CONF_CLIENT_ID: None,
CONF_CLIENT_ID: "ownerapi",
},
)
assert result["type"] == data_entry_flow.RESULT_TYPE_CREATE_ENTRY
Expand Down

0 comments on commit 6d1a3ec

Please sign in to comment.