nebius/SWE-bench-extra huggingface dataset:
Repository: somm15/PyViCare

Issue:
Outlet temperature
Hello,
I've just noticed that we are missing the dhw outlet temperature.
It would be something like:
`return self.service.getProperty("heating.dhw.sensors.temperature.outlet")["properties"]["value"]["value"]`

PS. Thank you for your great work!

Comments:

Patch:
diff --git a/PyViCare/PyViCareDevice.py b/PyViCare/PyViCareDevice.py
index c24a412..db3414f 100644
--- a/PyViCare/PyViCareDevice.py
+++ b/PyViCare/PyViCareDevice.py
@@ -210,6 +210,10 @@ class Device:
     def getDomesticHotWaterStorageTemperature(self):
         return self.service.getProperty("heating.dhw.sensors.temperature.hotWaterStorage")["properties"]["value"]["value"]
 
+    @handleNotSupported
+    def getDomesticHotWaterOutletTemperature(self):
+        return self.service.getProperty("heating.dhw.sensors.temperature.outlet")["properties"]["value"]["value"]
+
     @handleNotSupported
     def getDomesticHotWaterPumpActive(self):
         status =  self.service.getProperty("heating.dhw.pumps.primary")["properties"]["status"]["value"]


Test patch:
diff --git a/tests/test_Vitodens200W.py b/tests/test_Vitodens200W.py
index ec46fd0..1065406 100644
--- a/tests/test_Vitodens200W.py
+++ b/tests/test_Vitodens200W.py
@@ -38,3 +38,6 @@ class Vitodens200W(unittest.TestCase):
 
     def test_getDomesticHotWaterCirculationPumpActive(self):
         self.assertEqual(self.device.getDomesticHotWaterCirculationPumpActive(), True)
+
+    def test_getDomesticHotWaterOutletTemperature(self):
+        self.assertEqual(self.device.getDomesticHotWaterOutletTemperature(), 58)
Repository: somm15/PyViCare

Issue:
Possibility to read/set dhw circulation
Hey everyone,

is the above mentioned function working? I have setup PyViCare a few months ago, but this parameter shows 'True' all the time. My circulation is configured to be active only 5am-10pm.
By the way, is there also a way to influence the circulationpump? I would like to activate it only if someone is at home (respectively deactivate when no one is in the house).
I use a Viessmann heatpump Vitocal 200-S with Vitoconnect (in case that matters). The other readings (e.g. temperature, compressor,...) are fine.

Regards,
Anduril

Comments:

Patch:
diff --git a/PyViCare/PyViCareDevice.py b/PyViCare/PyViCareDevice.py
index 86a9898..f7254d6 100644
--- a/PyViCare/PyViCareDevice.py
+++ b/PyViCare/PyViCareDevice.py
@@ -339,6 +339,13 @@ class Device:
     def activateOneTimeCharge(self):
         return self.service.setProperty("heating.dhw.oneTimeCharge","activate","{}")
 
+    def setDomesticHotWaterCirculationSchedule(self,schedule):
+        return self.service.setProperty("heating.dhw.pumps.circulation.schedule", "setSchedule","{\"newSchedule\":"+str(schedule)+"}")
+
+    @handleNotSupported
+    def getDomesticHotWaterCirculationSchedule(self):
+        return self.service.getProperty("heating.dhw.pumps.circulation.schedule")["commands"]["setSchedule"]["params"]["newSchedule"]["constraints"]["modes"]
+      
     @handleNotSupported
     def getAvailableCircuits(self):
         return self.service.getProperty("heating.circuits")["properties"]["enabled"]["value"]


Test patch:
diff --git a/tests/test_Vitodens200W.py b/tests/test_Vitodens200W.py
index 3a358c0..ffd3857 100644
--- a/tests/test_Vitodens200W.py
+++ b/tests/test_Vitodens200W.py
@@ -41,3 +41,8 @@ class Vitodens200W(unittest.TestCase):
 
     def test_getDomesticHotWaterOutletTemperature(self):
         self.assertEqual(self.device.getDomesticHotWaterOutletTemperature(), 58)
+
+    def test_getDomesticHotWaterCirculationSchedule(self):
+        self.assertEqual(self.device.getDomesticHotWaterCirculationSchedule(), ['on'])
+
+
Repository: somm15/PyViCare

Issue:
When will pyViCare be updated in PyLib
typo in "/usr/local/lib/python3.9/dist-packages/PyViCare/PyViCareService.py" line 48

Error raised:
dump() missing 1 required positional argument: 'fp' in python json

Change
 post_data = data if isinstance(data, str) else json.dump(data)
to
 post_data = data if isinstance(data, str) else json.dumps(data)


Comments:

Patch:
diff --git a/PyViCare/PyViCareService.py b/PyViCare/PyViCareService.py
index bd4d1fe..f280fde 100644
--- a/PyViCare/PyViCareService.py
+++ b/PyViCare/PyViCareService.py
@@ -45,5 +45,5 @@ class ViCareService:
         url = buildSetPropertyUrl(
             self.accessor, property_name, action)
 
-        post_data = data if isinstance(data, str) else json.dump(data)
+        post_data = data if isinstance(data, str) else json.dumps(data)
         return self.oauth_manager.post(url, post_data)
\ No newline at end of file


Test patch:
diff --git a/tests/test_PyViCareService.py b/tests/test_PyViCareService.py
new file mode 100644
index 0000000..0fc4abe
--- /dev/null
+++ b/tests/test_PyViCareService.py
@@ -0,0 +1,27 @@
+import unittest
+from PyViCare.PyViCareService import ViCareDeviceAccessor, ViCareService
+from PyViCare.PyViCareOAuthManager import AbstractViCareOAuthManager
+from unittest.mock import Mock
+
+
+
+
+class GenericDevice(unittest.TestCase):
+
+    def setUp(self):
+        self.oauth_mock = Mock()
+        accessor = ViCareDeviceAccessor("[id]", "[serial]", "[device]")
+        self.service = ViCareService(self.oauth_mock, accessor)
+        
+    def test_getProperty(self):
+        self.service.getProperty("someprop")
+        self.oauth_mock.get.assert_called_once_with('/equipment/installations/[id]/gateways/[serial]/devices/[device]/features/someprop')
+
+    def test_setProperty_object(self):
+        self.service.setProperty("someprop", "doaction", {'name': 'abc'})
+        self.oauth_mock.post.assert_called_once_with('/equipment/installations/[id]/gateways/[serial]/devices/[device]/features/someprop/doaction', '{"name": "abc"}')
+
+    def test_setProperty_string(self):
+        self.service.setProperty("someprop", "doaction", '{}')
+        self.oauth_mock.post.assert_called_once_with('/equipment/installations/[id]/gateways/[serial]/devices/[device]/features/someprop/doaction', '{}')
+       
\ No newline at end of file
Repository: somm15/PyViCare

Issue:
getCurrentDesiredTemperature for standby is throwing not supported error
The only "circuit"-function not working since the last api-update is getCurrentDesiredTemperature().
error-message: 

```
site-packages\PyViCare\PyViCareUtils.py", line 45, in feature_flag_wrapper return wrapper(*args, **kwargs)
site-packages\PyViCare\PyViCareUtils.py", line 40, in wrapper raise PyViCareNotSupportedFeatureError(func.__name__)
PyViCare.PyViCareUtils.PyViCareNotSupportedFeatureError: getCurrentDesiredTemperature
```



_Originally posted by @kruemel746 in https://github.com/somm15/PyViCare/issues/194#issuecomment-931603388_

Comments:

Patch:
diff --git a/PyViCare/PyViCareDevice.py b/PyViCare/PyViCareDevice.py
index 18a993d..cda7fa1 100644
--- a/PyViCare/PyViCareDevice.py
+++ b/PyViCare/PyViCareDevice.py
@@ -440,6 +440,8 @@ class HeatingCircuit(DeviceWithComponent):
     @handleNotSupported
     def getCurrentDesiredTemperature(self):
         active_programm = self.getActiveProgram()
+        if active_programm in ['standby']:
+            return None
         return self.service.getProperty(f"heating.circuits.{self.circuit}.operating.programs.{active_programm}")["properties"]["temperature"]["value"]
 
     @handleNotSupported


Test patch:
diff --git a/tests/test_Vitocal222S.py b/tests/test_Vitocal222S.py
index abe4f81..a85b510 100644
--- a/tests/test_Vitocal222S.py
+++ b/tests/test_Vitocal222S.py
@@ -14,3 +14,7 @@ class Vitocal222S(unittest.TestCase):
         with now_is('2000-01-01 10:10:00'):
             self.assertEqual(
                 self.device.getDomesticHotWaterActiveMode(), 'normal')
+
+    def test_getCurrentDesiredTemperature(self):
+        self.assertEqual(
+            self.device.circuits[0].getCurrentDesiredTemperature(), 23)
diff --git a/tests/test_Vitodens300W.py b/tests/test_Vitodens300W.py
index 82b7c35..50d3302 100644
--- a/tests/test_Vitodens300W.py
+++ b/tests/test_Vitodens300W.py
@@ -49,6 +49,10 @@ class Vitodens300W(unittest.TestCase):
         self.assertEqual(
             self.device.getDomesticHotWaterCirculationPumpActive(), True)
 
+    def test_getCurrentDesiredTemperature(self):
+        self.assertEqual(
+            self.device.circuits[0].getCurrentDesiredTemperature(), None)
+
     # Is currently (August, 2021) not supported by the Viessman API even though it works for the Vitodens 200W.
     def test_getDomesticHotWaterOutletTemperature(self):
         self.assertRaises(PyViCareNotSupportedFeatureError,