hass-monta
hass-monta copied to clipboard
Add wallet transactions
I had a couple of old transactions in my personal wallet, so I've added the api call and setup to create a personal wallet sensor. Currently this is set to retrieve the last 7 days, but potentially that could be configureable.
Not sure if there are other wallets it could retrieve, it certainly doesn't retrieve data from my enterprise team wallet.
I split this into two commits because my dev environment is setup using standard HA dev container which automatically does some formatting. The first commit makes no code changes, it is just formatting.
This may answer this request - https://github.com/nickknissen/hass-monta/issues/65
Hi @RogerSelwyn
Thank you for your contribution! I've made some changes to how many wallet transactions are fetched. If you have transactions older than 7 days they are not fetched. So fare as i can see wallet transactions fetched by newest transactions first.
Good for me, I only have 2 so couldn’t tell if it would bring everything or just a reasonable set
@nickknissen Thank you for the update.
A few remarks. No update in Hacs.
When I install manually I get the following error. (Everything fine with @RogerSelwyn ,s PR)
`Setup failed for custom integration 'monta': Unable to import component: cannot import name 'ATTR_CHARGEPOINTS' from 'custom_components.monta.const' (/config/custom_components/monta/const.py)
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/loader.py", line 981, in async_get_component
comp = await self.hass.async_add_import_executor_job(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/loader.py", line 1041, in _get_component
ComponentProtocol, importlib.import_module(self.pkg_path)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/util/loop.py", line 144, in protected_loop_func
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/importlib/init.py", line 90, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/setup.py", line 322, in _async_setup_component
component = await integration.async_get_component()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/loader.py", line 1001, in async_get_component
self._component_future.result()
File "/usr/src/homeassistant/homeassistant/loader.py", line 993, in async_get_component
comp = self._get_component()
^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/loader.py", line 1041, in _get_component
ComponentProtocol, importlib.import_module(self.pkg_path)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/util/loop.py", line 144, in protected_loop_func
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/importlib/init.py", line 90, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "
@Bluhme1 I have not had the time to test it properly after my changes. Since a new release has not been issued.
I have fixed the problem you encountered on the main branch. Will do a proper release after i have done some more testing.
@nickknissen No problem. I just want to contribute the best I can. Not being a programmer I contribute by testing. (and some feature requests) I think you and @RogerSelwyn have made a very complete and mature integration Thank you
And the latest fix works