Antoni-Czaplicki / vulcan-for-hassio

Vulcan inegration for home assistamt
26 stars 3 forks source link

Error while setting up vulcan platform for sensor #9

Closed darkjumpy closed 3 years ago

darkjumpy commented 3 years ago

Hi, I would like to use your integration but my HA gets an error when setting up Vulcan. I'm using the newest version of HA on raspberry pi 4 with 4GB RAM. Integration was installed by HACS. I can set up integration but after it, I don't get any entities, and in the logs, I have this information

Logger: homeassistant.components.sensor Source: custom_components/vulcan/get_data.py:24 Integration: Sensor (documentation, issues) First occurred: 9:01:44 PM (1 occurrences) Last logged: 9:01:44 PM

Error while setting up vulcan platform for sensor Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 198, in _async_setup_platform await asyncio.shield(task) File "/config/custom_components/vulcan/sensor.py", line 30, in async_setup_entry hass.data[DOMAIN]["lessons"] = await get_lesson_info( File "/config/custom_components/vulcan/get_data.py", line 24, in get_lesson_info temp_dict["room"] = Lesson.room.code AttributeError: 'NoneType' object has no attribute 'code'

Antoni-Czaplicki commented 3 years ago

Try to update to the latest version (0.8.4)

darkjumpy commented 3 years ago

Unfortunately, it didn't change anything. I even tried to delete the integration, ".vulcan" folder and reinstall the integration

Antoni-Czaplicki commented 3 years ago

Can you submit a bug from the latest version? should be a little bit different.

darkjumpy commented 3 years ago

Logger: homeassistant.components.sensor Source: custom_components/vulcan/get_data.py:130 Integration: Sensor (documentation, issues) First occurred: 12:42:17 PM (1 occurrences) Last logged: 12:42:17 PM

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 198, in _async_setup_platform
    await asyncio.shield(task)
  File "/config/custom_components/vulcan/sensor.py", line 37, in async_setup_entry
    hass.data[DOMAIN]["grade"] = await get_latest_grade(
  File "/config/custom_components/vulcan/get_data.py", line 130, in get_latest_grade
    async for grade in await client.data.get_grades():
  File "/usr/local/lib/python3.8/site-packages/vulcan/hebe/data/_grade.py", line 117, in get
    yield Grade.load(grade)
  File "/usr/local/lib/python3.8/site-packages/vulcan/hebe/model/_serializable.py", line 49, in load
    return to_model(cls, data)
  File "/usr/local/lib/python3.8/site-packages/related/functions.py", line 104, in to_model
    value = cls(**value)
  File "<attrs generated init vulcan.hebe.data._grade.Grade>", line 12, in __init__
    _setattr('column', __attr_converter_column(column))
  File "/usr/local/lib/python3.8/site-packages/related/converters.py", line 40, in __call__
    return to_model(self.cls, value)
  File "/usr/local/lib/python3.8/site-packages/related/functions.py", line 104, in to_model
    value = cls(**value)
  File "<attrs generated init vulcan.hebe.data._grade.GradeColumn>", line 24, in __init__
    __attr_validator_category(self, __attr_category, self.category)
  File "/usr/local/lib/python3.8/site-packages/attr/validators.py", line 35, in __call__
    raise TypeError(
TypeError: ("'category' must be <class 'vulcan.hebe.data._grade.GradeCategory'> (got None that is a <class 'NoneType'>).", Attribute(name='category', default=NOTHING, validator=<instance_of validator for type <class 'vulcan.hebe.data._grade.GradeCategory'>>, repr=True, eq=True, order=True, hash=None, init=True, metadata=mappingproxy({'key': 'Category'}), type=<class 'vulcan.hebe.data._grade.GradeCategory'>, converter=<related.converters.to_child_field.<locals>.ChildConverter object at 0x7f818b5100>, kw_only=False), <class 'vulcan.hebe.data._grade.GradeCategory'>, None)
Antoni-Czaplicki commented 3 years ago

This issue is API related, we are currently waiting for a new version to be released.

Antoni-Czaplicki commented 3 years ago

Ok, please try to update to the latest version (0.8.5) - it should fix that problem.

darkjumpy commented 3 years ago

Everything is working now. Thank you!