|
4 | 4 | import sys |
5 | 5 | from ..utils.utils import pretty_print_except |
6 | 6 |
|
7 | | -from typing import TYPE_CHECKING, Dict, List, Optional, Union |
| 7 | +from typing import TYPE_CHECKING, Dict, List, Optional |
8 | 8 |
|
9 | 9 | from ThermiaOnlineAPI.const import ( |
10 | 10 | REG_BRINE_IN, |
@@ -724,27 +724,63 @@ def operational_status_auxiliary_heater_15kw(self): |
724 | 724 | ) |
725 | 725 |
|
726 | 726 | @property |
727 | | - def operational_status_compressor_status(self): |
| 727 | + def operational_status_compressor_status(self) -> Optional[bool]: |
| 728 | + if ( |
| 729 | + self.__visible_operational_statuses_map is None |
| 730 | + or "COMPR" not in self.__visible_operational_statuses_map.values() |
| 731 | + ): |
| 732 | + return None |
| 733 | + |
728 | 734 | return "COMPR" in self.running_operational_statuses |
729 | 735 |
|
730 | 736 | @property |
731 | | - def operational_status_brine_pump_status(self): |
| 737 | + def operational_status_brine_pump_status(self) -> Optional[bool]: |
| 738 | + if ( |
| 739 | + self.__visible_operational_statuses_map is None |
| 740 | + or "BRINEPUMP" not in self.__visible_operational_statuses_map.values() |
| 741 | + ): |
| 742 | + return None |
| 743 | + |
732 | 744 | return "BRINEPUMP" in self.running_operational_statuses |
733 | 745 |
|
734 | 746 | @property |
735 | | - def operational_status_radiator_pump_status(self): |
| 747 | + def operational_status_radiator_pump_status(self) -> Optional[bool]: |
| 748 | + if ( |
| 749 | + self.__visible_operational_statuses_map is None |
| 750 | + or "RADIATORPUMP" not in self.__visible_operational_statuses_map.values() |
| 751 | + ): |
| 752 | + return None |
| 753 | + |
736 | 754 | return "RADIATORPUMP" in self.running_operational_statuses |
737 | 755 |
|
738 | 756 | @property |
739 | | - def operational_status_cooling_status(self): |
| 757 | + def operational_status_cooling_status(self) -> Optional[bool]: |
| 758 | + if ( |
| 759 | + self.__visible_operational_statuses_map is None |
| 760 | + or "COOLING" not in self.__visible_operational_statuses_map.values() |
| 761 | + ): |
| 762 | + return None |
| 763 | + |
740 | 764 | return "COOLING" in self.running_operational_statuses |
741 | 765 |
|
742 | 766 | @property |
743 | | - def operational_status_hot_water_status(self): |
| 767 | + def operational_status_hot_water_status(self) -> Optional[bool]: |
| 768 | + if ( |
| 769 | + self.__visible_operational_statuses_map is None |
| 770 | + or "HOT_WATER" not in self.__visible_operational_statuses_map.values() |
| 771 | + ): |
| 772 | + return None |
| 773 | + |
744 | 774 | return "HOT_WATER" in self.running_operational_statuses |
745 | 775 |
|
746 | 776 | @property |
747 | | - def operational_status_heating_status(self): |
| 777 | + def operational_status_heating_status(self) -> Optional[bool]: |
| 778 | + if ( |
| 779 | + self.__visible_operational_statuses_map is None |
| 780 | + or "HEATING" not in self.__visible_operational_statuses_map.values() |
| 781 | + ): |
| 782 | + return None |
| 783 | + |
748 | 784 | return "HEATING" in self.running_operational_statuses |
749 | 785 |
|
750 | 786 | @property |
|
0 commit comments