Commit Graph

639 Commits

Author SHA1 Message Date
Stefan Allius
010ae2b2c7 Merge branch 'dev-0.12' of https://github.com/s-allius/tsun-gen3-proxy into titan-scan 2024-10-15 22:18:30 +02:00
Stefan Allius
db06d8c8e6 define __slots__ 2024-10-15 22:11:19 +02:00
Stefan Allius
3863454a84 set TZ to "Europe/Berlin" 2024-10-15 21:59:32 +02:00
Stefan Allius
5775cb1ce3 try MathRobin/timezone-action@v1.1 2024-10-15 21:53:11 +02:00
Stefan Allius
5d61a261b1 set set-timezone to UTC 2024-10-15 21:37:01 +02:00
Stefan Allius
bbda66e455 disable set-timezone action 2024-10-15 21:28:57 +02:00
Stefan Allius
0c7bf7956d define __slots__ for class ByteFifo 2024-10-15 21:25:09 +02:00
Stefan Allius
6b9c13ddfe Merge branch 'dev-0.11' of https://github.com/s-allius/tsun-gen3-proxy into main 2024-10-15 20:30:04 +02:00
Stefan Allius
24840e67c0 adapt start_reg 2024-10-13 22:38:21 +02:00
Stefan Allius
2dd89d3174 git push 2024-10-13 19:45:11 +02:00
Stefan Allius
a6ffcc0949 update version 0.11 v0.11.0-rc.1 v0.11.0 2024-10-13 18:24:00 +02:00
Stefan Allius
c956c13d13 Dev 0.11 (#200)
* Code Cleanup (#158)


* print coverage report

* create sonar-project property file

* install all py dependencies in one step

* code cleanup

* reduce cognitive complexity

* do not build on *.yml changes

* optimise versionstring handling (#159)

- Reading the version string from the image updates
  it even if the image is re-pulled without re-deployment

* fix linter warning

* exclude *.pyi filese

* ignore some rules for tests

* cleanup (#160)

* Sonar qube 3 (#163)

fix SonarQube warnings in modbus.py

* Sonar qube 3 (#164)


* fix SonarQube warnings

* Sonar qube 3 (#165)

* cleanup

* Add support for TSUN Titan inverter
Fixes #161


* fix SonarQube warnings

* fix error

* rename field "config"

* SonarQube reads flake8 output

* don't stop on flake8 errors

* flake8 scan only app/src for SonarQube

* update flake8 run

* ignore flake8 C901

* cleanup

* fix linter warnings

* ignore changed *.yml files

* read sensor list solarman data packets

* catch 'No route to' error and log only in debug mode

* fix unit tests

* add sensor_list configuration

* adapt unit tests

* fix SonarQube warnings

* Sonar qube 3 (#166)

* add unittests for mqtt.py

* add mock

* move test requirements into a file

* fix unit tests

* fix formating

* initial version

* fix SonarQube warning

* Sonar qube 4 (#169)

* add unit test for inverter.py

* fix SonarQube warning

* Sonar qube 5 (#170)

* fix SonarLints warnings

* use random IP adresses for unit tests

* Docker: The description ist missing (#171)

Fixes #167

* S allius/issue167 (#172)

* cleanup

* Sonar qube 6 (#174)

* test class ModbusConn

* Sonar qube 3 (#178)

* add more unit tests

* GEN3: don't crash on overwritten msg in the receive buffer

* improve test coverage und reduce test delays

* reduce cognitive complexity

* fix merge

* fix merge conflikt

* fix merge conflict

* S allius/issue182 (#183)

* GEN3: After inverter firmware update the 'Unknown Msg Type' increases continuously
Fixes #182

* add support for Controller serial no and MAC

* test hardening

* GEN3: add support for new messages of version 3 firmwares

* bump libraries to latest versions

- bump aiomqtt to version 2.3.0
- bump aiohttp to version 3.10.5

* improve test coverage

* reduce cognective complexity

* fix target preview

* remove dubbled fixtures

* increase test coverage

* Update README.md (#185)

update badges

* S allius/issue186 (#187)

* Parse more values in Server Mode
Fixes #186

* read OUTPUT_COEFFICIENT and MAC_ADDR in SrvMode

* fix unit test

* increase test coverage

* S allius/issue186 (#188)

* increase test coverage

* update changelog

* add dokumentation

* change default config

* Update README.md (#189)

Config file is now foldable

* GEN3: Invalid Contact Info Msg (#192)

Fixes #191

* Refactoring async stream (#194)

* GEN3: Invalid Contact Info Msg
Fixes #191

* introduce ifc with FIFOs

* add object factory

* use AsyncIfc class with FIFO

* declare more methods as classmethods

* - refactoring

- remove _forward_buffer
- make async_write private

* remove _forward_buffer

* refactoring

* avoid mqtt handling for invalid serial numbers

* add two more callbacks

* FIX update_header_cb handling

* split AsyncStream in two classes

* split ConnectionG3(P) in server and client class

* update class diagramm

* refactor server creation

* remove duplicated imports

* reduce code duplication

* move StremPtr instances into Inverter class

* resolution of connection classes

- remove ConnectionG3Client
- remove ConnectionG3Server
- remove ConnectionG3PClient
- remove ConnectionG3PServer

* fix server connections

* fix client loop closing

* don't overwrite self.remote in constructor

* update class diagramm

* fixes

- fixes null pointer accesses
- initalize AsyncStreamClient with proper
  StreamPtr instance

* add close callback

* refactor close handling

* remove connection classes

* move more code into InverterBase class

* remove test_inverter_base.py

* add abstract inverter interface class

* initial commit

* fix sonar qube warnings

* rename class Inverter into Proxy

* fix typo

* move class InverterIfc into a separate file

* add more testcases

* use ProtocolIfc class

* add unit tests for AsyncStream class

* icrease test coverage

* reduce cognitive complexity

* increase test coverage

* increase tes coverage

* simplify heartbeat handler

* remove obsolete tx_get method

* add more unittests

* update changelog

* remove __del__ method for proper gc runs

* check releasing of ModbusConn instances

* call garbage collector to release unreachable objs

* decrease ref counter after the with block

* S allius/issue196 (#198)

* fix healthcheck

- on infrastructure with IPv6 support localhost
  might be resolved to an IPv6 adress. Since the
  proxy only support IPv4 for now, we replace
  localhost by 127.0.0.1, to fix this

* merge from main
2024-10-13 18:12:10 +02:00
Stefan Allius
85fe7261d5 Merge branch 'main' into dev-0.11 2024-10-13 18:07:38 +02:00
Stefan Allius
d4b618742c merge from main 2024-10-13 17:31:55 +02:00
Stefan Allius
719c6f703a S allius/issue196 (#198)
* fix healthcheck

- on infrastructure with IPv6 support localhost
  might be resolved to an IPv6 adress. Since the
  proxy only support IPv4 for now, we replace
  localhost by 127.0.0.1, to fix this
2024-10-13 17:13:07 +02:00
Stefan Allius
62ea2a9e6f Refactoring async stream (#194)
* GEN3: Invalid Contact Info Msg
Fixes #191

* introduce ifc with FIFOs

* add object factory

* use AsyncIfc class with FIFO

* declare more methods as classmethods

* - refactoring

- remove _forward_buffer
- make async_write private

* remove _forward_buffer

* refactoring

* avoid mqtt handling for invalid serial numbers

* add two more callbacks

* FIX update_header_cb handling

* split AsyncStream in two classes

* split ConnectionG3(P) in server and client class

* update class diagramm

* refactor server creation

* remove duplicated imports

* reduce code duplication

* move StremPtr instances into Inverter class

* resolution of connection classes

- remove ConnectionG3Client
- remove ConnectionG3Server
- remove ConnectionG3PClient
- remove ConnectionG3PServer

* fix server connections

* fix client loop closing

* don't overwrite self.remote in constructor

* update class diagramm

* fixes

- fixes null pointer accesses
- initalize AsyncStreamClient with proper
  StreamPtr instance

* add close callback

* refactor close handling

* remove connection classes

* move more code into InverterBase class

* remove test_inverter_base.py

* add abstract inverter interface class

* initial commit

* fix sonar qube warnings

* rename class Inverter into Proxy

* fix typo

* move class InverterIfc into a separate file

* add more testcases

* use ProtocolIfc class

* add unit tests for AsyncStream class

* icrease test coverage

* reduce cognitive complexity

* increase test coverage

* increase tes coverage

* simplify heartbeat handler

* remove obsolete tx_get method

* add more unittests

* update changelog

* remove __del__ method for proper gc runs

* check releasing of ModbusConn instances

* call garbage collector to release unreachable objs

* decrease ref counter after the with block
2024-10-13 16:07:01 +02:00
Stefan Allius
c84b610229 also scan GEN3(PLUS) inverters 2024-10-13 09:33:23 +02:00
Stefan Allius
5dc890dde0 Merge branch 'refactoring-async-stream' of https://github.com/s-allius/tsun-gen3-proxy into titan-scan 2024-10-11 20:30:09 +02:00
Stefan Allius
0c10cc32dc update changelog 2024-10-11 20:29:20 +02:00
Stefan Allius
71f581eb0b add more unittests 2024-10-10 22:41:13 +02:00
Stefan Allius
a4acddd769 remove obsolete tx_get method 2024-10-10 00:30:10 +02:00
Stefan Allius
724f6f3b22 simplify heartbeat handler 2024-10-10 00:00:32 +02:00
Stefan Allius
18c3020282 increase tes coverage 2024-10-09 23:59:56 +02:00
Stefan Allius
e127716317 increase test coverage 2024-10-08 23:48:49 +02:00
Stefan Allius
5790b657d0 update start-REG 2024-10-07 23:20:21 +02:00
Stefan Allius
5d4ff9051d Merge branch 'refactoring-async-stream' of https://github.com/s-allius/tsun-gen3-proxy into titan-scan 2024-10-06 21:28:12 +02:00
Stefan Allius
595b68ba03 reduce cognitive complexity 2024-10-06 21:20:53 +02:00
Stefan Allius
d7628689f0 icrease test coverage 2024-10-06 21:15:46 +02:00
Stefan Allius
e074a39f5a add unit tests for AsyncStream class 2024-10-06 17:43:40 +02:00
Stefan Allius
9852f44dfa use ProtocolIfc class 2024-10-05 21:11:42 +02:00
Stefan Allius
c7d0a91371 add more testcases 2024-10-05 01:35:04 +02:00
Stefan Allius
5b68610f78 move class InverterIfc into a separate file 2024-10-05 01:34:03 +02:00
Stefan Allius
0b79a37fe7 fix typo 2024-10-05 01:33:05 +02:00
Stefan Allius
00e9a4534d rename class Inverter into Proxy 2024-10-04 23:37:05 +02:00
Stefan Allius
3a94afb48d fix sonar qube warnings 2024-10-04 01:50:24 +02:00
Stefan Allius
949f3c9608 initial commit 2024-10-04 01:41:25 +02:00
Stefan Allius
cd2f41a713 add abstract inverter interface class 2024-10-04 01:35:44 +02:00
Stefan Allius
84034127e3 remove test_inverter_base.py 2024-10-03 15:11:22 +02:00
Stefan Allius
22d59ed659 move more code into InverterBase class 2024-10-03 15:08:07 +02:00
Stefan Allius
cfe2c9cb9d remove connection classes 2024-10-02 23:40:42 +02:00
Stefan Allius
39aba31bbd refactor close handling 2024-10-01 19:50:42 +02:00
Stefan Allius
a1441fb4fd add close callback 2024-09-30 19:17:06 +02:00
Stefan Allius
f2ade43410 fixes
- fixes null pointer accesses
- initalize AsyncStreamClient with proper
  StreamPtr instance
2024-09-30 19:14:50 +02:00
Stefan Allius
8f695518bd update class diagramm 2024-09-30 19:13:29 +02:00
Stefan Allius
b3068a256c don't overwrite self.remote in constructor 2024-09-30 19:12:49 +02:00
Stefan Allius
2336955bb8 fix client loop closing 2024-09-29 21:11:53 +02:00
Stefan Allius
8a745b2d10 Merge branch 'refactoring-async-stream' of https://github.com/s-allius/tsun-gen3-proxy into titan-scan 2024-09-29 20:52:08 +02:00
Stefan Allius
518375e8a8 fix server connections 2024-09-29 20:49:08 +02:00
Stefan Allius
b57ded1a73 Merge branch 'refactoring-async-stream' of https://github.com/s-allius/tsun-gen3-proxy into titan-scan 2024-09-29 20:27:28 +02:00
Stefan Allius
41aeac4168 resolution of connection classes
- remove ConnectionG3Client
- remove ConnectionG3Server
- remove ConnectionG3PClient
- remove ConnectionG3PServer
2024-09-29 20:08:04 +02:00