-
Notifications
You must be signed in to change notification settings - Fork 76
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
Solax g2+g4 #2157
base: master
Are you sure you want to change the base?
Solax g2+g4 #2157
Conversation
|
||
|
||
class SolaxBat(AbstractBat): | ||
def __init__(self, | ||
device_id: int, | ||
device_config: Union[Dict, Solax], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
device_config: Union[Dict, Solax], | |
device_config: Solax, |
Das Dictionary wird in der Subdata in eine Klasse konvertiert.
exported, imported = [value * 10 for value in self.__tcp_client.read_input_registers( | ||
0x043D, [ModbusDataType.UINT_32] * 2, wordorder=Endian.Little, unit=unit)] | ||
|
||
if SolaxVersion(self.device_config.configuration.version) == SolaxVersion.G3: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if SolaxVersion(self.device_config.configuration.version) == SolaxVersion.G3: | |
elif SolaxVersion(self.device_config.configuration.version) == SolaxVersion.G3: |
Muss hier nicht ein elif hin? Sonst werden beim G2 die Werte im else-Zweig nochmal versucht auszulesen.
with self.__tcp_client: | ||
power = self.__tcp_client.read_input_registers(22, ModbusDataType.INT_16, unit=self.__modbus_id) | ||
soc = self.__tcp_client.read_input_registers(28, ModbusDataType.UINT_16, unit=self.__modbus_id) | ||
# kein Speicher für Versionen G2 und G4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
with self.__tcp_client:
Im Device wird in der update-Funktion der Kontext-Handler gestartet. Ist er hier nochmal erforderlich?
power = self.__tcp_client.read_input_registers(0x0413, ModbusDataType.UINT_16, unit=unit) * -1 | ||
exported = self.__tcp_client.read_input_registers( | ||
0x0423, ModbusDataType.UINT_32, wordorder=Endian.Little, unit=unit) * 100 | ||
if SolaxVersion(self.device_config.configuration.version) == SolaxVersion.G3: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if SolaxVersion(self.device_config.configuration.version) == SolaxVersion.G3: | |
elif SolaxVersion(self.device_config.configuration.version) == SolaxVersion.G3: |
|
||
|
||
class SolaxInverter(AbstractInverter): | ||
def __init__(self, | ||
device_id: int, | ||
device_config: Union[Dict, Solax], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
device_config: Union[Dict, Solax], | |
device_config: Solax, |
|
||
|
||
class SolaxCounter(AbstractCounter): | ||
def __init__(self, | ||
device_id: int, | ||
device_config: Union[Dict, Solax], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
device_config: Union[Dict, Solax], | |
device_config: Solax, |
self.modbus_id = modbus_id | ||
self.ip_address = ip_address | ||
self.port = port | ||
self.version = version |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Muss die neue Einstellung version nicht auch noch in update_config hinzugefügt werden?
openWB/openwb-ui-settings#621