solarlog-cli 0.7.0__tar.gz → 0.7.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {solarlog_cli-0.7.0 → solarlog_cli-0.7.1}/.coverage +0 -0
- {solarlog_cli-0.7.0 → solarlog_cli-0.7.1}/PKG-INFO +1 -1
- {solarlog_cli-0.7.0 → solarlog_cli-0.7.1}/pyproject.toml +1 -1
- {solarlog_cli-0.7.0 → solarlog_cli-0.7.1}/src/solarlog_cli/solarlog_client.py +7 -0
- {solarlog_cli-0.7.0 → solarlog_cli-0.7.1}/.devcontainer/devcontainer.json +0 -0
- {solarlog_cli-0.7.0 → solarlog_cli-0.7.1}/.github/workflows/pylint.yml +0 -0
- {solarlog_cli-0.7.0 → solarlog_cli-0.7.1}/.github/workflows/python-publish.yml +0 -0
- {solarlog_cli-0.7.0 → solarlog_cli-0.7.1}/.github/workflows/ruff.yml +0 -0
- {solarlog_cli-0.7.0 → solarlog_cli-0.7.1}/.github/workflows/tests.yml +0 -0
- {solarlog_cli-0.7.0 → solarlog_cli-0.7.1}/.github/workflows/typing.yml +0 -0
- {solarlog_cli-0.7.0 → solarlog_cli-0.7.1}/.gitignore +0 -0
- {solarlog_cli-0.7.0 → solarlog_cli-0.7.1}/.vscode/settings.json +0 -0
- {solarlog_cli-0.7.0 → solarlog_cli-0.7.1}/.vscode/tasks.json +0 -0
- {solarlog_cli-0.7.0 → solarlog_cli-0.7.1}/LICENSE +0 -0
- {solarlog_cli-0.7.0 → solarlog_cli-0.7.1}/README.md +0 -0
- {solarlog_cli-0.7.0 → solarlog_cli-0.7.1}/pytest.ini +0 -0
- {solarlog_cli-0.7.0 → solarlog_cli-0.7.1}/requirements.txt +0 -0
- {solarlog_cli-0.7.0 → solarlog_cli-0.7.1}/src/solarlog_cli/__init__.py +0 -0
- {solarlog_cli-0.7.0 → solarlog_cli-0.7.1}/src/solarlog_cli/py.typed +0 -0
- {solarlog_cli-0.7.0 → solarlog_cli-0.7.1}/src/solarlog_cli/solarlog_connector.py +0 -0
- {solarlog_cli-0.7.0 → solarlog_cli-0.7.1}/src/solarlog_cli/solarlog_exceptions.py +0 -0
- {solarlog_cli-0.7.0 → solarlog_cli-0.7.1}/src/solarlog_cli/solarlog_models.py +0 -0
- {solarlog_cli-0.7.0 → solarlog_cli-0.7.1}/tests/__init__.py +0 -0
- {solarlog_cli-0.7.0 → solarlog_cli-0.7.1}/tests/__snapshots__/test_solarlog_cli.ambr +0 -0
- {solarlog_cli-0.7.0 → solarlog_cli-0.7.1}/tests/conftest.py +0 -0
- {solarlog_cli-0.7.0 → solarlog_cli-0.7.1}/tests/fixtures/basic_data.json +0 -0
- {solarlog_cli-0.7.0 → solarlog_cli-0.7.1}/tests/fixtures/basic_data_during_update.json +0 -0
- {solarlog_cli-0.7.0 → solarlog_cli-0.7.1}/tests/fixtures/basic_data_no_power.json +0 -0
- {solarlog_cli-0.7.0 → solarlog_cli-0.7.1}/tests/fixtures/battery_data.json +0 -0
- {solarlog_cli-0.7.0 → solarlog_cli-0.7.1}/tests/fixtures/battery_data_without_battery.json +0 -0
- {solarlog_cli-0.7.0 → solarlog_cli-0.7.1}/tests/fixtures/device_data_1.json +0 -0
- {solarlog_cli-0.7.0 → solarlog_cli-0.7.1}/tests/fixtures/device_data_2.json +0 -0
- {solarlog_cli-0.7.0 → solarlog_cli-0.7.1}/tests/fixtures/device_data_3.json +0 -0
- {solarlog_cli-0.7.0 → solarlog_cli-0.7.1}/tests/fixtures/device_data_4.json +0 -0
- {solarlog_cli-0.7.0 → solarlog_cli-0.7.1}/tests/fixtures/device_list.json +0 -0
- {solarlog_cli-0.7.0 → solarlog_cli-0.7.1}/tests/fixtures/device_list_access_denied.json +0 -0
- {solarlog_cli-0.7.0 → solarlog_cli-0.7.1}/tests/fixtures/energy_per_inverter.json +0 -0
- {solarlog_cli-0.7.0 → solarlog_cli-0.7.1}/tests/fixtures/extended_data.json +0 -0
- {solarlog_cli-0.7.0 → solarlog_cli-0.7.1}/tests/fixtures/power_per_inverter.json +0 -0
- {solarlog_cli-0.7.0 → solarlog_cli-0.7.1}/tests/fixtures/user_salts.json +0 -0
- {solarlog_cli-0.7.0 → solarlog_cli-0.7.1}/tests/ruff.toml +0 -0
- {solarlog_cli-0.7.0 → solarlog_cli-0.7.1}/tests/syrupy.py +0 -0
- {solarlog_cli-0.7.0 → solarlog_cli-0.7.1}/tests/test_solarlog_cli.py +0 -0
|
Binary file
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: solarlog_cli
|
|
3
|
-
Version: 0.7.
|
|
3
|
+
Version: 0.7.1
|
|
4
4
|
Summary: Python library to access the Solar-Log
|
|
5
5
|
Project-URL: Repository, https://github.com/dontinelli/solarlog_cli.git
|
|
6
6
|
Project-URL: Issues, https://github.com/dontinelli/solarlog_cli/issues
|
|
@@ -41,6 +41,7 @@ class Client:
|
|
|
41
41
|
|
|
42
42
|
self._hashed_pwd: bool = False
|
|
43
43
|
self._close_session: bool = True
|
|
44
|
+
self._token = "" #required for older firmware, where cookie is not sufficient
|
|
44
45
|
|
|
45
46
|
async def test_connection(self) -> bool:
|
|
46
47
|
"""Test the connection to Solar-Log."""
|
|
@@ -114,6 +115,9 @@ class Client:
|
|
|
114
115
|
self.session.cookie_jar.update_cookies(
|
|
115
116
|
{"SolarLog": response.cookies["SolarLog"].value})
|
|
116
117
|
|
|
118
|
+
if not self._hashed_pwd:
|
|
119
|
+
self._token = response.cookies["SolarLog"].value
|
|
120
|
+
|
|
117
121
|
_LOGGER.debug("response: %s", text)
|
|
118
122
|
_LOGGER.debug("cookies: %s", response.cookies)
|
|
119
123
|
_LOGGER.debug("Login successful, token: %s",
|
|
@@ -131,6 +135,9 @@ class Client:
|
|
|
131
135
|
|
|
132
136
|
header = {"Content-Type": "text/html", "X-SL-CSRF-PROTECTION": "1"}
|
|
133
137
|
|
|
138
|
+
if self._token != "":
|
|
139
|
+
body = f"token={self._token}; " + body
|
|
140
|
+
|
|
134
141
|
_LOGGER.debug("HTTP-request header: %s", header)
|
|
135
142
|
_LOGGER.debug("HTTP-request body: %s", body)
|
|
136
143
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|