-
Notifications
You must be signed in to change notification settings - Fork 204
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2775 from LKuemmel/cp_power_factor
add power factor, powers and frequency to cp
- Loading branch information
Showing
9 changed files
with
91 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
from abc import abstractmethod | ||
from typing import List, Tuple | ||
|
||
from modules.common import modbus | ||
|
||
|
||
class AbstractCounter: | ||
@abstractmethod | ||
def __init__(self, modbus_id: int, client: modbus.ModbusTcpClient_) -> None: | ||
pass | ||
|
||
@abstractmethod | ||
def get_currents(self) -> List[float]: | ||
return [0]*3 | ||
|
||
@abstractmethod | ||
def get_exported(self) -> float: | ||
return 0 | ||
|
||
@abstractmethod | ||
def get_frequency(self) -> float: | ||
return 50 | ||
|
||
@abstractmethod | ||
def get_imported(self) -> float: | ||
return 0 | ||
|
||
@abstractmethod | ||
def get_power(self) -> Tuple[List[float], float]: | ||
return [0]*3, 0 | ||
|
||
@abstractmethod | ||
def get_power_factors(self) -> List[float]: | ||
return [0]*3 | ||
|
||
@abstractmethod | ||
def get_voltages(self) -> List[float]: | ||
return [230]*3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters