Code Monkey home page Code Monkey logo

ztm's People

Contributors

peetereczek avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

grzonu

ztm's Issues

constant errors in logs

Every couple of minutes i get error like this for each of my sensors:

2020-11-13 12:28:28 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.ztm_126_from_1097_01 fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 278, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 474, in async_device_update
    raise exc
  File "/config/custom_components/ztm/sensor.py", line 139, in async_update
    self._timetable = self.map_results(res.get('response', []))
  File "/config/custom_components/ztm/sensor.py", line 212, in map_results
    return [parse_raw_timetable(row) for row in response['result']]
  File "/config/custom_components/ztm/sensor.py", line 212, in <listcomp>
    return [parse_raw_timetable(row) for row in response['result']]
  File "/config/custom_components/ztm/sensor.py", line 218, in parse_raw_timetable
    for val in raw_result['values']:
TypeError: string indices must be integers

Update from sensor failed

Hello

Getting recently below error. Can you advice please ?
Logger: homeassistant.helpers.entity
Source: custom_components/ztm/sensor.py:218
Integration: ztm (documentation, issues)
First occurred: 21:25:48 (12 occurrences)
Last logged: 21:26:48

Update for sensor.ztm_11_from_5061_04 fails
Update for sensor.ztm_171_from_5061_01 fails
Update for sensor.ztm_26_from_5061_04 fails
Update for sensor.ztm_10_from_5061_04 fails
Update for sensor.ztm_523_from_5061_01 fails
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 350, in async_update_ha_state
await self.async_device_update()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 558, in async_device_update
raise exc
File "/config/custom_components/ztm/sensor.py", line 139, in async_update
self._timetable = self.map_results(res.get('response', []))
File "/config/custom_components/ztm/sensor.py", line 212, in map_results
return [parse_raw_timetable(row) for row in response['result']]
File "/config/custom_components/ztm/sensor.py", line 212, in
return [parse_raw_timetable(row) for row in response['result']]
File "/config/custom_components/ztm/sensor.py", line 218, in parse_raw_timetable
for val in raw_result['values']:
TypeError: string indices must be integers

Update for sensor. fails

Cześć
Od wczoraj mam powtarzający się błąd - 2020-11-16 07:55:18 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.xxxxxx fails i leci mi tak po wszystkich utworzonych. Co może być przyczyną?

Rafał

No data - MySQL

Cześć,

Przełaczyłem HA na bazę MySQL, zamiast wbudowanej. Po starcie jest taki probłem:
2020-07-24 10:24:18 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.ztm_105_from_5045_01 fails
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 272, in async_update_ha_state
await self.async_device_update()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 463, in async_device_update
await self.async_update() # type: ignore
File "/config/custom_components/ztm/sensor.py", line 139, in async_update
self._timetable = self.map_results(res.get('response', []))
File "/config/custom_components/ztm/sensor.py", line 212, in map_results
return [parse_raw_timetable(row) for row in response['result']]
File "/config/custom_components/ztm/sensor.py", line 212, in
return [parse_raw_timetable(row) for row in response['result']]
File "/config/custom_components/ztm/sensor.py", line 218, in parse_raw_timetable
for val in raw_result['values']:
TypeError: string indices must be integers

Pozostałe integracje działają

Niewygodne wyświetlanie historii

W nocy autobusy i tramwaje nie kursują, więc pozostaje długi czas do następnego, psuje to ogólny widok historii, bo nie widać nic sensownego.
obraz

Missing version number

No 'version' key in the manifest file for custom integration 'ztm'. This will not be allowed in a future version of Home Assistant. Please report this to the maintainer of 'ztm'

Taki prosty extractor z linka

Napisałem w php prosty extractor przystanków, może jakoś da sie to zintegrować

<form method="post" action="/">
    Link: <input type="text" name="link"><br>
    <input type="submit" value="Parsuj">
</form>
<?php
if ($_SERVER['REQUEST_METHOD'] == 'POST'){
    $parts = parse_url($_POST['link']);
    parse_str($parts['query'], $query);
    echo "number: " . $query['wtp_ln']. "<br>";
    echo "stop_id: " . $query['wtp_st']. "<br>";
    echo "stop_number: \"" .$query['wtp_pt'] . "\"";
}

'NoneType' object has no attribute 'get'

Po ostatnim updacie (0.2.0) zaczęło sypać mi błędami:
Cannot connect to ZTM API endpoint.
Sprawdziłem klucz i po stronie API wszystko wygląda OK.
Zapewne w wyniku czego, pojawia się błąd odczytu:

Update for sensor.ztm_xxx_from_xxxx_xx fails
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 279, in async_update_ha_state
await self.async_device_update()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 459, in async_device_update
await self.async_update()
File "/config/custom_components/ztm/sensor.py", line 136, in async_update
if res.get('error', ''):
AttributeError: 'NoneType' object has no attribute 'get'

Powrót do 0.1.3 usuwa problem.

Linie nocne

Za dokumentacją:

number:
      description: Bus/tram line number
      required: true
      type: int

Nie da się teraz podać np. linii nocnej. Np. N64

Deprecated async_timeout.timeout in HA 2022.2

Detected integration that called async_timeout.timeout with loop keyword argument. The loop keyword argument is deprecated and calls will fail after Home Assistant 2022.2. Please report issue to the custom component author for ztm using this method at custom_components/ztm/sensor.py, line 233: with async_timeout.timeout(REQUEST_TIMEOUT, loop=loop):

Błędy w wersji 0.1.3 - nie działają sensory na dziennych linii

konfiguracja:

  - platform: ztm
    api_key: !secret ztm_api_key
    lines:
      - number: 126
        stop_id: 1097
        stop_number: "01"
      - number: 176
        stop_id: 1097
        stop_number: "01"
      - number: 126
        stop_id: 1097
        stop_number: "03"
      - number: N64
        stop_id: 1097
        stop_number: "02"
      - number: N64
        stop_id: 1096
        stop_number: "02"

błędy:

2020-02-05 22:55:31 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.ztm_126_departures_from_1097_01 fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 279, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 459, in async_device_update
    await self.async_update()
  File "/config/custom_components/ztm/sensor.py", line 155, in async_update
    if  nocny != '':
UnboundLocalError: local variable 'nocny' referenced before assignment
2020-02-05 22:55:31 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.ztm_176_departures_from_1097_01 fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 279, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 459, in async_device_update
    await self.async_update()
  File "/config/custom_components/ztm/sensor.py", line 155, in async_update
    if  nocny != '':
UnboundLocalError: local variable 'nocny' referenced before assignment
2020-02-05 22:55:31 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.ztm_126_departures_from_1097_03 fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 279, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 459, in async_device_update
    await self.async_update()
  File "/config/custom_components/ztm/sensor.py", line 155, in async_update
    if  nocny != '':
UnboundLocalError: local variable 'nocny' referenced before assignment
2020-02-05 22:56:31 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.ztm_126_departures_from_1097_01 fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 279, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 459, in async_device_update
    await self.async_update()
  File "/config/custom_components/ztm/sensor.py", line 155, in async_update
    if  nocny != '':
UnboundLocalError: local variable 'nocny' referenced before assignment
2020-02-05 22:56:31 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.ztm_126_departures_from_1097_03 fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 279, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 459, in async_device_update
    await self.async_update()
  File "/config/custom_components/ztm/sensor.py", line 155, in async_update
    if  nocny != '':
UnboundLocalError: local variable 'nocny' referenced before assignment
2020-02-05 22:56:31 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.ztm_176_departures_from_1097_01 fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 279, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 459, in async_device_update
    await self.async_update()
  File "/config/custom_components/ztm/sensor.py", line 155, in async_update
    if  nocny != '':
UnboundLocalError: local variable 'nocny' referenced before assignment

Błąd parsowania wyników

Wyniki odpowiedzi na zapytanie nie są parsowane do sensora

Update for sensor.ztm_217_from_3309_02 failsTraceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 279, in async_update_ha_state await self.async_device_update()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 459, in async_device_update await self.async_update()
File "/config/custom_components/ztm/sensor.py", line 139, in async_update self._timetable = self.map_results(res.get('response', []))
File "/config/custom_components/ztm/sensor.py", line 212, in map_results return [parse_raw_timetable(row) for row in response['result']]
File "/config/custom_components/ztm/sensor.py", line 212, in <listcomp> return [parse_raw_timetable(row) for row in response['result']]
File "/config/custom_components/ztm/sensor.py", line 218, in parse_raw_timetable for val in raw_result['values']:
TypeError: string indices must be integers

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.