Skip to content

NoneType attribute label exception on Skybox inverter query #99

@rpdrewes

Description

@rpdrewes

Running suns.py on my Outback Skybox inverter starts to retrieve good data, but then gets an exception:

      [many lines...]
      External Battery Voltage (V):                        54 V         
      Total DC Current (A):                                 0 A         
      Total Power (W):                                      0 W         
      Set Operation (SetOp):                                1           
      Set Inverter State (SetInvState):                     1           
Traceback (most recent call last):
  File "pysunspec/scripts/suns.py", line 91, in <module>
    if model.model_type.label:
AttributeError: 'NoneType' object has no attribute 'label'

If I just put a check in suns.py to continue if the object is None, I can avoid the error and the query keeps getting good data.

This may be the Skybox's fault returning data with some fields not populated, but it might be a good idea to program more defensively and put in a check in the code?

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