Skip to content

Fix and optimize digitalloggers platform#9203

Merged
pvizeli merged 6 commits into
home-assistant:devfrom
dale3h:fix-digitalloggers
Aug 29, 2017
Merged

Fix and optimize digitalloggers platform#9203
pvizeli merged 6 commits into
home-assistant:devfrom
dale3h:fix-digitalloggers

Conversation

@dale3h
Copy link
Copy Markdown
Member

@dale3h dale3h commented Aug 28, 2017

Description:

The Digital Loggers Switch platform was broken by #8878. This is a refactor with optimization that fixes it. The platform previously made 10+ HTTP requests upon initialization, and has now been reduced to two.

Related issue (if applicable): fixes #8990

Checklist:

If the code communicates with devices, web services, or third-party tools:

  • Local tests with tox run successfully. Your PR cannot be merged unless tests pass

self._parent_device.statuslocal[self.outletnumber - 1][1]
)

outlet_status = self._parent_device._statuslist[self._outlet_number - 1]
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line too long (80 > 79 characters)

@dale3h dale3h added this to the 0.52.2 milestone Aug 28, 2017
@pvizeli pvizeli merged commit 3807150 into home-assistant:dev Aug 29, 2017
@dale3h dale3h deleted the fix-digitalloggers branch August 29, 2017 14:37
Copy link
Copy Markdown
Member

@MartinHjelmare MartinHjelmare left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't update be called before adding the entity?

)

add_devices(devices, True)
add_devices(outlets)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without True as the second argument here, update will not be called before adding each device. I don't think that is intended.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, I intentionally change this because I was able to get all of the necessary data from the iteration of power_switch (line 69).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, thanks for the clarification!

matemaciek added a commit to matemaciek/home-assistant that referenced this pull request Aug 30, 2017
* upstream/dev: (113 commits)
  Fix fitbit error when trying to access token after upgrade. (home-assistant#9183)
  Upgrade sendgrid to 5.0.1 (home-assistant#9215)
  Upgrade pyasn1 to 0.3.3 and pyasn1-modules to 0.1.1 (home-assistant#9216)
  directv: extended discovery via REST api, bug fix  (home-assistant#8800)
  Bayesian Binary Sensor (home-assistant#8810)
  Add cloud auth support (home-assistant#9208)
  Abode push events and lock, cover, and switch components (home-assistant#9095)
  Lint Sonarr tests
  Upgrade pymysensors to 0.11.1 (home-assistant#9212)
  Refactor rfxtrx (home-assistant#9117)
  Issue home-assistant#6893 in rfxtrx (home-assistant#9130)
  Support for season sensor (home-assistant#8958)
  Add counter component (home-assistant#9146)
  Fix and optimize digitalloggers platform (home-assistant#9203)
  Prevent error when no forecast data was available (home-assistant#9176)
  Add "status" to Sonarr sensor (home-assistant#9204)
  fix worldtidesinfo home-assistant#9184 (home-assistant#9201)
  Update pushbullet.py (home-assistant#9200)
  Fix dht22 when no data was read initially home-assistant#8976 (home-assistant#9198)
  Prevent iCloud exceptions in logfile (home-assistant#9179)
  ...
@balloob balloob mentioned this pull request Sep 7, 2017
@home-assistant home-assistant locked and limited conversation to collaborators Dec 11, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Digital Loggers switch capability broken after upgrade to 0.51.2

6 participants