Skip to content

Support for heat pumps#13

Merged
somm15 merged 1 commit into
openviess:masterfrom
rappenze:feature/heatpump
Jul 30, 2019
Merged

Support for heat pumps#13
somm15 merged 1 commit into
openviess:masterfrom
rappenze:feature/heatpump

Conversation

@rappenze
Copy link
Copy Markdown

The current implementation of PyViCare supports only gas heatings. The ViCare API is available as well for heat pumps from Viessmann, but there are some differences in the available API methods.

This pull request does the following:

  • Refactoring of the ViCareSession into ViCareSession and ViCareService, where ViCareService contains the logic to access the API (this is the common code shared by gas heating and heat pumps) and the ViCareSession which contains the API methods for gas heatings. ViCareSession is 100% compatible with the previous Version.

  • New class ViCareHeatPumpSession which contains the API methods for heat pumps.

Would be great if you can accept this pull request and push to PyPi.org, the I will do next step by creating a pull request to https://github.com/oischinger/ha_vicare so we can support it as well in home assistant.

Code tested for heat pump only as I do not have access to a Viessmann gas heating.

@michelde
Copy link
Copy Markdown

I have a Vitocal 333-G BWT 331.B08 and it also works with mine. Great enhancement.

@vandenberghev
Copy link
Copy Markdown

Hi @somm15, any idea when you could integrate this PR and update the PyPI package?

@somm15
Copy link
Copy Markdown
Collaborator

somm15 commented Jul 28, 2019

I'll have a look tonight. Sorry, I didn't receive any notification for the PR...

@somm15 somm15 merged commit 13e13c7 into openviess:master Jul 30, 2019
@somm15
Copy link
Copy Markdown
Collaborator

somm15 commented Jul 30, 2019

I did merge your PR.
Thanks for the refactoring.

However, I had to refactor quite a lot. 90% of the code was common with the gaz boiler.
So the new structure is:

  • PyViCareDevice.py contains the class Device
  • PyViCareGazBoiler extends the Device class and adds gaz specific features, the class in named GazBoiler
  • PyViCareHeatPump extends the Device class and adds heat pump specific features, the class in named HeatPump

ViCareSession is just there because of legacy and is deprecated.

Naming of classes is now a little more coherent. I don't plan changing it in the future.
Note that you now have to import using:

from PyViCare.PyViCareDevice import Device
from PyViCare.PyViCareGazBoiler import GazBoiler
from PyViCare.PyViCareService import ViCareService
from PyViCare.PyViCare import ViCareSession

In the future, I plan to make:
Service --> Installations --> Gateways --> Devices (HeatPump or GazBoiler)
Just initiating the service will create the sub components. This will be more convenient for big installations.

CFenner referenced this pull request in CFenner/PyViCare Dec 26, 2023
Nibot1 pushed a commit to Nibot1/PyViCare that referenced this pull request Aug 17, 2024
* remove mypy config

* add mypy config to toml

* add mypy workflow

* update dependency

* remove request dependency

* remove commented deps

* add requests dependency
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants