Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moved INFO_RESOURCES access to instance get method #47

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion pydaikin/daikin_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ async def _get_resource(self, path: str, params: Optional[dict] = None):
async def update_status(self, resources=None):
"""Update status from resources."""
if resources is None:
resources = self.INFO_RESOURCES
resources = self.get_info_resources()
resources = [
resource
for resource in resources
Expand All @@ -205,6 +205,9 @@ async def update_status(self, resources=None):

self._register_energy_consumption_history()

def get_info_resources(self):
return self.INFO_RESOURCES

def show_values(self, only_summary=False):
"""Print values."""
if only_summary:
Expand Down
5 changes: 4 additions & 1 deletion pydaikin/daikin_brp069.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,12 +147,15 @@ async def init(self):
else:
await self.update_status(self.HTTP_RESOURCES)

def get_info_resources(self):
if self.support_energy_consumption:
self.INFO_RESOURCES += [ # pylint: disable=invalid-name
return self.INFO_RESOURCES + [
'aircon/get_day_power_ex',
'aircon/get_week_power',
]

return self.INFO_RESOURCES

async def _update_settings(self, settings):
"""Update settings to set on Daikin device."""
# start with current values
Expand Down
Loading