Code Monkey home page Code Monkey logo

asx_sensor's People

Contributors

simonhq avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

greenthegarden

asx_sensor's Issues

Connection error

Hi Simon. Thanks for this project. I wondered whether the API has potentially changed as I am getting the following error after manually installing and configuring it. I am using Core version core-2021.1.4 and Superviser version supervisor-2021.01.5

2021-01-23 05:59:31.936321 INFO AppDaemon: Terminating asx_sensor
2021-01-23 05:59:31.945316 INFO AppDaemon: Initializing app asx_sensor using class Get_ASX_info from module asx_sensor
2021-01-23 05:59:31.973421 WARNING asx_sensor: asx_sensor: Entity sensor.asx_data_last_updated not found in namespace default
2021-01-23 05:59:31.978148 INFO AppDaemon: asx_sensor: Entity sensor.asx_data_last_updated created in namespace: default
2021-01-23 05:59:32.126534 WARNING asx_sensor: ------------------------------------------------------------
2021-01-23 05:59:32.128817 WARNING asx_sensor: Unexpected error running initialize() for asx_sensor
2021-01-23 05:59:32.133753 WARNING asx_sensor: ------------------------------------------------------------
2021-01-23 05:59:32.236846 WARNING asx_sensor: Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/urllib3/connection.py", line 159, in _new_conn
    conn = connection.create_connection(
  File "/usr/lib/python3.8/site-packages/urllib3/util/connection.py", line 61, in create_connection
    for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
  File "/usr/lib/python3.8/socket.py", line 918, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -2] Name does not resolve
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/urllib3/connectionpool.py", line 670, in urlopen
    httplib_response = self._make_request(
  File "/usr/lib/python3.8/site-packages/urllib3/connectionpool.py", line 381, in _make_request
    self._validate_conn(conn)
  File "/usr/lib/python3.8/site-packages/urllib3/connectionpool.py", line 976, in _validate_conn
    conn.connect()
  File "/usr/lib/python3.8/site-packages/urllib3/connection.py", line 308, in connect
    conn = self._new_conn()
  File "/usr/lib/python3.8/site-packages/urllib3/connection.py", line 171, in _new_conn
    raise NewConnectionError(
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPSConnection object at 0x757618f8>: Failed to establish a new connection: [Errno -2] Name does not resolve
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/requests/adapters.py", line 439, in send
    resp = conn.urlopen(
  File "/usr/lib/python3.8/site-packages/urllib3/connectionpool.py", line 724, in urlopen
    retries = retries.increment(
  File "/usr/lib/python3.8/site-packages/urllib3/util/retry.py", line 439, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='www.asx.com.au', port=443): Max retries exceeded with url: /asx/1/share/WOW/prices?interval=daily&count=1 (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x757618f8>: Failed to establish a new connection: [Errno -2] Name does not resolve'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/appdaemon/app_management.py", line 150, in initialize_app
    await utils.run_in_executor(self, init)
  File "/usr/lib/python3.8/site-packages/appdaemon/utils.py", line 290, in run_in_executor
    response = future.result()
  File "/usr/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/appdaemon/apps/asx_sensor/asx_sensor.py", line 70, in initialize
    self.load()
  File "/config/appdaemon/apps/asx_sensor/asx_sensor.py", line 116, in load
    response = requests.request("GET", url, headers=self.headers, data = self.payload)
  File "/usr/lib/python3.8/site-packages/requests/api.py", line 61, in request
    return session.request(method=method, url=url, **kwargs)
  File "/usr/lib/python3.8/site-packages/requests/sessions.py", line 530, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/lib/python3.8/site-packages/requests/sessions.py", line 643, in send
    r = adapter.send(request, **kwargs)
  File "/usr/lib/python3.8/site-packages/requests/adapters.py", line 516, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='www.asx.com.au', port=443): Max retries exceeded with url: /asx/1/share/WOW/prices?interval=daily&count=1 (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x757618f8>: Failed to establish a new connection: [Errno -2] Name does not resolve'))
2021-01-23 05:59:32.239169 WARNING asx_sensor: ------------------------------------------------------------

Adding ASX code A200 creates key error 0

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.