Skip to content

Error, NoneType logged after every update #285

@kiptonk

Description

@kiptonk

Whenever I call Switchbot.update(), press(), or turn_on() it logs the following twice:

No advertisement data to update
NoneType: None

I traced it to here:

if not self._sb_adv_data:
_LOGGER.exception("No advertisement data to update")
return

But I'm not sure of the fix. There is a failed check on advertising data but that seems intentional because of:

class SwitchbotDeviceOverrideStateDuringConnection(SwitchbotBaseDevice):
"""Base Representation of a Switchbot Device.
This base class ignores the advertisement data during connection and uses the
data from the device instead.
"""

The return of None and Logger.exception() seem erroneous but maybe something higher up is the better fix.

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