* add tsun_v2 default configuration * Add port 10000 for gen 3 plus inverters * add monitor_sn for solarman support * listen on port 10000 for solarman inverters * initial version for gen 3 plus support * refactoring split gen3 and gen3plus * refactoring * refactoring classes * refactor proxy statistic counter * - fix loggin levels - user super() in close() and __del__() * add config for gen 3 plus * Add solarman config support * refacot Message.. classes * rename class MessageG3 into Talent * refactor close() handler * refactor disc() handler * move loop() into the base class AsyncStream * move async_read, _write and _forward into base class * Cleanup * move server_loop and client_loop into basic class * add msg forwarding for solarman V5 protocol * move server_loop() and client_loop to class AsyncStream * rename AsyncStreamxx ton Connectionxx * fix unit tests * make more attributes privae * load .env file * wait after last test * ignore .env * add response handler * Update README.md * update unreleased changes * home assistant add more diagnostic values * fix typo * Update README.md Definition of the inverter generations added to the compatibility table * add ha couter for 'Internal SW Exceptions' * Update README.md Fixes an incorrect marking in the display of the configuration file * Update README.md Planning documented for MS-2000 support * S allius/issue33 (#34) * - fix issue 33 The TSUN Cloud now responds to contact_info and get_time messages with an empty display message and not with a response message as before. We tried to parse data from the empty message, which led to an exception * Add test with empty conn_ind from inverter * version 0.5.5 * add tsun_v2 default configuration * Add port 10000 for gen 3 plus inverters * add monitor_sn for solarman support * listen on port 10000 for solarman inverters initial version for gen 3 plus support * refactoring split gen3 and gen3plus * refactoring * refactoring classes * refactor proxy statistic counter * - fix loggin levels - user super() in close() and __del__() * add config for gen 3 plus * Add solarman config support * refacot Message.. classes * rename class MessageG3 into Talent * refactor close() handler * refactor disc() handler * move loop() into the base class AsyncStream * move async_read, _write and _forward into base class * Cleanup * move server_loop and client_loop into basic class * add msg forwarding for solarman V5 protocol * move server_loop() and client_loop to class AsyncStream * rename AsyncStreamxx ton Connectionxx * fix unit tests * make more attributes privae load .env file * wait after last test * ignore .env * add response handler
37 lines
844 B
Python
37 lines
844 B
Python
import logging
|
|
# import gc
|
|
from async_stream import AsyncStream
|
|
from gen3.talent import Talent
|
|
|
|
logger = logging.getLogger('conn')
|
|
|
|
|
|
class ConnectionG3(AsyncStream, Talent):
|
|
|
|
def __init__(self, reader, writer, addr, remote_stream, server_side: bool,
|
|
id_str=b'') -> None:
|
|
AsyncStream.__init__(self, reader, writer, addr)
|
|
Talent.__init__(self, server_side, id_str)
|
|
|
|
self.remoteStream = remote_stream
|
|
|
|
'''
|
|
Our puplic methods
|
|
'''
|
|
def close(self):
|
|
AsyncStream.close(self)
|
|
Talent.close(self)
|
|
# logger.info(f'AsyncStream refs: {gc.get_referrers(self)}')
|
|
|
|
async def async_create_remote(self) -> None:
|
|
pass
|
|
|
|
async def async_publ_mqtt(self) -> None:
|
|
pass
|
|
|
|
'''
|
|
Our private methods
|
|
'''
|
|
def __del__(self):
|
|
super().__del__()
|