Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding ASX code A200 creates key error 0 #3

Open
grantclem opened this issue Mar 29, 2023 · 2 comments
Open

Adding ASX code A200 creates key error 0 #3

grantclem opened this issue Mar 29, 2023 · 2 comments

Comments

@grantclem
Copy link

When adding this ASX code to the ticker line of the yaml file the following error occurs:

TICKER: "VGS,VAS,A200"

2023-03-29 10:07:51.880121 WARNING Error: ------------------------------------------------------------
2023-03-29 10:09:17.735538 WARNING asx_sensor: ------------------------------------------------------------
2023-03-29 10:09:17.735861 WARNING asx_sensor: Unexpected error running initialize() for asx_sensor
2023-03-29 10:09:17.736096 WARNING asx_sensor: ------------------------------------------------------------
2023-03-29 10:09:17.736693 WARNING asx_sensor: Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/appdaemon/app_management.py", line 165, in initialize_app
    await utils.run_in_executor(self, init)
  File "/usr/lib/python3.10/site-packages/appdaemon/utils.py", line 337, in run_in_executor
    response = future.result()
  File "/usr/lib/python3.10/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/appdaemon/apps/utils/asx_sensor.py", line 70, in initialize
    self.load()
  File "/config/appdaemon/apps/utils/asx_sensor.py", line 138, in load
    div_y = jtags[0]['year']
KeyError: 0

It appears to happen when adding any asx code that is alpha numeric.

@simonhq
Copy link
Owner

simonhq commented Mar 29, 2023

Hi Grant,

I have greatly simplified the code base and hopefully reduced the need for the shares to be the 'company' type.

I have tested with A200 but unsure which others may have been affected.

The changes should be available through HACS. let me know if works.

Simon.

@grantclem
Copy link
Author

Hi Simon,

Thanks for your prompt reply - the error appears to have gone, but was initially getting a Class error... may want capitalise line 30 "class Get_ASX_Info(hass.Hass):" in your code.. Appears to be now working... thanks very much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants