Skip to content

16k attribute limitation  #504

@koopee

Description

@koopee

Hello @Hellowlol @Teme-V

Could this issue be solved by not storing the heavy list attributes in the database at all? That way the attributes would remain usable, and as far as I can tell we’d at least avoid exceeding the 16384-byte limit. I can’t think of a reason the lists need to be written to the database, so perhaps those could simply be omitted. This might be one possible solution.

I have this kind of workaround at the moment and looks like it works.

Under sensor.py

class NordpoolSensor(SensorEntity):
    "Sensors data"

    _attr_device_class = SensorDeviceClass.MONETARY
    _attr_suggested_display_precision = None
    _attr_state_class = SensorStateClass.TOTAL
    # Do not write list attributes to database.
    _unrecorded_attributes = frozenset({"raw_today", "raw_tomorrow", "today", "tomorrow"})

Originally posted by @sippe2 in #491 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions