* Update dependency pytest-asyncio to v1.2.0
* don't stop the event loop between test
set the loop_scope to session for async tests
* remove loop_scope="session"
---------
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Stefan Allius <stefan.allius@t-online.de>
* add links to add-on urls
* Add translations
* set app.testing to get exceptions during test
* improve unit-tests for the web-UI
* update changelog
* extend languages tests
* workaround for github runner
* set no of pv modules for MS800 GEN3PLUS inverters
* fix unit test
* increase test coverage
* change the PV module handling
- in default we set the number of modules now to
two. So with the first data from the inverter
we only register two modules. After we determine
the inverter module, the number can increase to
four and more PV modules will be registered.
With the default value of 4, we register always
4 modules and can't reduce the number of areas
when we detect that the inverter only supoorts
two PV modules
* add dcu_power MQTT topic
* add DCU_COMMAND counter
* test invalid dcu_power values
* handle and test DCU Command responses
* test dcu commands from the TSUN cloud
* cleanup MQTT topic handling
* update changelog
* test MQTT error and exception handling
* increase test coverage
* test dispatcher exceptions
* fix full_topic definition in dispatch test
* scan log files for timestamp as creating timestamp
* increase test coverage
* add an empty file for unit tests
- the empty file is needed for unit tests to force
an exception on the try to scan the first line
for an timestamp
* set timezone of scanned creation time
* setup logger for hypercorn and dashboard
* use logger.ini to setup dashboard logger
* workaround: restore the hypercorn logger config
- quart/hyercorn overwrites the logger config.
as a workaround we restore the config at the
beginning of a request
* fix the hypercorn log handler only once
* change proxy into a ASGI application
- move Quart init from server.py into app.py
- create Server class for config and loggin setup
- restore hypercorn logging configuration after
start of Quart/Hypercorn
* move get_log_level into Server class
* define config in test_emu_init_close
* remove Web() instance from the testcase
- with importing app.py The blueprint Web() will
automatically created and a second call in test-
cases must avoided
* add unit tests
* move code from app.py into server.py
* test the init_logging_system() method
* add HypercornLogHndl tests
* fix deprecated pytest async warning
- Cleanup pending async tasks
- fix deprecated warning about event_loop
* add unit test for error handling in build_config()
* coverage: ignore quart template files
* check print output in test_save_and_restore
* update changelog
* add Dashboards log handler to all known loggers
* add list of last 3 warnings/errors to page
* add note list to page
* create LogHandler for the dashboard
- simple memory log handler which stores the last
64 warnings/errors for the dashboard
* render warnings/errors as note list
* add page for warnings and errors
* fix double defined build target
* add well done message if no errors in the logs
* translate page titles
* more translations
* add Notes page and table for important messages
* add unit tests
* display proxy version on dashboard
* add MQTT page
* styles adjusted on the different pages
- use same colors
- add bordered shadow to all cards and tables
* fix unit tests
* migrate the conn table to a general table
- rename the template file
- get headline from table description
* remove footer from index page
* make version string translateable
* cleanup
* remove stripped table rows
* add mqtt info table
* translate mqtt page
* don't fetch notes list for the log-page
* fix Mqtt init call for unit tests
* add mqtt-fetch test
* check received counter in unit test
* add route for log file deletion
* add modal for senity check before file deletion
* add trash icon which unhide the modal
* add more translations
* increase test coverage
* cleanup
* store logging path in Config class
* rename template files and page files
* jump to referer page
- after changing the language, we jump to
the referer page, if the attribute exists
* build and send list of log-files
* rename Download page into Log files
* initialize log-path in test config
* improve dashboard unit tests
- add log file tests
- check content-languages after language switch
* initialize config structure for log-file tests
* add test log file to project
* add sub_dir to test log path
- non files must be skipped. To test this we add
a sub directory to the test log directory
* add german translations
* set quart debug flag for debug versions
* update changelog
* add button for languages setting
* build a web module for the dashboard
- load all python module from local dir
- initialize Blueprint and Babel
* set a default key for secure cookies
* add translations to docker container
* improve translation build
- clean target erases the *.pot
- don't modify the resurt of url_for() calls
- don't translate the language description
* translate connection table, fix icon
* build relative urls for HA ingress
* fix unit test, increase coverage
* design counter on connection board
* display time of last update and add reload button
* chance `Updated` field to a real button
* Provide counter values for the dashboard
* change background color ot the top branch
- use dark-grey instead of black to reduce the contrast
* change color of counter tiles
* test proxy connection counter handling
* prepare conn-table and notes list building
* remove obsolete menue points
* store client mode for dashboard
* store inverters serial number for the dashboard
* store inverters serial number
* build connection table for dashboard
* add connection table to dashboard
* fix responsiveness of the tiles
* adapt unit tests
* remove test fake code
* increase test coverage, remove obsolete if statement
* add optional java script to fetch data regullary
* change file extension to `html.j2` for templates
* fix route for fetch data
- for running in iframes (e.g. HA ingress) we must
use relative path in the URLs
* increase test coverage
* remove unused statements
* configure path to web files for Quart
* copy web-file into the add-on container
* add test template and stylesheet
* add w3.css dashboard
* fix unit test for test dashboard
* add Roboto font
* add awesome web font
* add all favicon formats
* load fonts locally
* adapt unit tests
* add all font and favicons to add-on
* fix sonarqube warnings
* add unit tests for all favicons
* Add two states build from the measurements
- Batterie Status calculated from the batt current
- Power Supply State calc from the out Power
* improve test coverage
* Cleanup MQTT json format for DCU batterie
- add hw and sw version
- rename total generation into total charging energy
- rename cell temperature sensors
- restructure json format
- adapt unit tests
* revert changed test packages
* move forward_at_cmd_resp into InfosG3P class
- the variable is shared between the two connections
of an inverter. One is for the TSUN cloud and the
other for the device.
* use inverter class to share values between
the two protocol instances of a proxy
- move forward_at_cmd_resp into class InverterG3P
- store inverter ptr in Solarman_V5 instances
- add inverter ptr to all constructurs of protocols
- adapt doku and unit tests-
- add integration tests for AT+ commands which
check the forwarding from and to the TSUN cloud
* adapt and improve the unit tests
- fix node_id declaration, which always has a / at
the end. See config grammar for this rule
- set global var test to default after test run
* Update dependency flake8 to v7.2.0
* Flake8: ignore F821 errors, due of False Positives
# cleanup some unit tests
---------
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Stefan Allius <stefan.allius@t-online.de>
* set equipment model dor DCU1000 devices
* DCU1000: add temp sensor and mppt states
* DCU1000: add total generation
* add more DCU1000 registers for MODBUS polling
* improve names of batterie measurements
* add more diagnostic registers
* adapt unit tests
* move uml files into subfolder
* add sensors for batterie cell voltages
* swap On and Off for MPPT status
* split register map into multiple maps
* add base support reg mapping 0x01900000
* fix shadowed builtin
* detect reg mapping for sensor automatically
* add device and test regs for MS-3000
* add more register mappings
* fix unit tests
* add more MS-3000 registers
* build modell string for TSUN MS-3000
* add MS3000 unit test
* remove obsolete method __set_config_parms
* fix start addr of modbus scans
- in server mode the start addr must be reduced
by mb_step
* add tests for sensor_list of ms-3000 inverters
* MS-3000: add integer test register
* DCU-1000: add Out Status register
* add integer test and batterie out register
* fix Sonar Qube finding
* DCU-1000: add temp sensors
* accept DCU serial number starting with '410'
* determine sensor-list by serial number
* adapt unit test for DCU support
* send first batterie measurements to home assistant
* add test case for sensor-list==3036
* add more registers for batteries
* improve error logging (Monitoring SN)
* update the add-on repro only for one stage
* add configuration for energie storages
* add License and Readme file to the add-on
* addon: add date and time to dev and debug docker container tag
* disable duplicate code check for config.py
* cleanup unit test, remove trailing whitespaces
* update changelog
* fix example config for batteries
* cleanup config.jinja template
* fix comments
* improve help texts
* remove apostrophes from fmt strings
- thanks to @onkelenno for the suggestion
* improve the logger initializing
- don't overwrite the logging.ini settings if the
env variable LOG_LVL isn't well defined
- Thanks to @onkelenno for the idea to improve
* set default argument for LOG_LVL to INFO in docker files
* adapt unit test
* add ha_addons repository to cscode workspace
* Issue220 ha addon dokumentation update (#232)
* initial DOCS.md for Addon
* links to Mosquitto and Adguard
* replaced _ by . for PV-Strings
* mentioned add-on installation method in README.md
* fix most of the markdown linter warnings
* add missing alt texts
* added nice add repository to my Home Assistant badges
---------
Co-authored-by: Michael Metz <michael.metz@siemens.com>
Co-authored-by: Stefan Allius <stefan.allius@t-online.de>
* S allius/issue216 (#235)
* improve docker run
- establish multistage Dockerfile
- build a python wheel for all needed packages
- remove unneeded tools like apk for runtime
* pin versions, fix hadolint warnings
* merge from dev-0.12
---------
Co-authored-by: Michael Metz <michael.metz@siemens.com>
* Issue220 ha addon dokumentation update (#245)
* revised config disclaimer
* add newline at end of file to fix linter warning
---------
Co-authored-by: Michael Metz <michael.metz@siemens.com>
* 238 ha addon repository check (#244)
* move Makefile and bake file into parent folder
* build config.yaml from template
* use Makefile instead of build shell script
* ignore temporary or created files
* add rules for building the add-on repository
* add rel version of add-on
* add jinja2-cli
* ignore inverter replays which a older than 1 day (#246)
* S allius/issue7 (#248)
* report alarm and fault bitfield to ha
* define the alarm and fault names
* configure log path and max number of daily log files (#243)
* configure log path and max number of daily log files
* don't use a subfolder for configs
* use make instead of a build script
* mount /homeassistant/tsun-proxy
* Add venv to base image
* give write access to mounted folder
* intial checkin, ignore SC1091
* set advanced and stage value in config.yaml
* fix typo
* added watchdog and removed Port 8127 from mapping
* fixed typo and use new add-on repro
- change the install button to install from
https://github.com/s-allius/ha-addons
* add addon-rel target
* disable watchdog due to exceptions in the ha supervisor
* update changelog
---------
Co-authored-by: Michael Metz <michael.metz@siemens.com>
* Update README.md (#251)
install `https://github.com/s-allius/ha-addons` as repro for our add-on
* add german language file (#253)
* fix return type get_extra_info in FakeWriter
* move global startup code into main methdod
* pin version of base image
* avoid forwarding to a private (lokal) IP addr (#256)
* avoid forwarding to a private (lokal) IP addr
* test DNS resolver issues
* increase test coverage
* update changelog
* fix client_mode configuration block (#252)
* fix client_mode block
* add client mode
* fix tests with client_mode values
* log client_mode configuration
* add forward flag for client_mode
* improve startup logging
* added client_mode example
* adjusted translation files
* AT commands added
* typo
* missing "PLUS"
* link to config details
* improve log msg for config problems
* improve log msg on config errors
* improve log msg for config problems
* copy CHANGELOG.md into add-on repro
---------
Co-authored-by: Michael Metz <michael.metz@siemens.com>
* rename "ConfigErr" to match naming convention
* disable test coverage for __main__
* update changelog version 0.12
---------
Co-authored-by: metzi <147942647+mime24@users.noreply.github.com>
Co-authored-by: Michael Metz <michael.metz@siemens.com>
* add some reader classes to get the configuration
* adapt unittests
* get config from json or toml file
* loop over all config readers to get the configuration
* rename config test files
* use relative paths for coverage test in vscode
* do not throw an error for missing config files
* remove obsolete tests
* use dotted key notation for pv sub dictonary
* log config reading progress
* remove create_config_toml.py
* remove obsolete tests for the ha_addon
* disable mosquitto tests if the server is down
* ignore main method for test coverage
* increase test coverage
* pytest-cov: use relative_files only on github, so coverage will work with vscode locally
* remove unneeded imports
* add missing test cases
* disable branch coverage, cause its not reachable
* update changelog
* add addon-dev target
* initial version
* use prebuild docker image
* initial version for multi arch images
* fix missing label latest
* create log and config folder first.
* clean up and translate to english
* set labels with docker bake
* add addon-debug and addon-dev targets
* pass version number to proxy at runtime
* add two more callbacks
* get addon version from app
* deploy rc addon container to ghcr
* move ha_addon test into subdir
* fix crash on container restart
- mkdir -p returns no error even if the director
exists
* prepation for unit testing
- move script into a method
* added further config to schema
* typo fixed
* added monitor_sn + PV-strings 3-6 to create toml
* added options.json for testing
* prepare pytest and coverage for addons
* fix missing values in resulting config.toml
- define mqtt default values
- convert filter configuration
* first running unittest for addons
* add ha_addons
* increase test coverage
* test empty options.json file for HA AddOn
* fix pytest call in terminal
* improve test coverage
* remove uneeded options.json
* move config.py into subdir cnf
---------
Co-authored-by: Michael Metz <michael.metz@siemens.com>
* - fix pytest setup that can be startet from the rootdir
- support python venv environment
- add pytest.ini
- move common settings from .vscode/settings.json into pytest.ini
- add missing requirements
- fix import paths for pytests
* - support python venv environment
* initial version
* - add missing requirements python-dotenv
* fix import paths for pytests
* fix pytest warnings
* initial version
* report 5 slowest test durations
* add more vscode settings for python
* Add SolarmanEmu class
* Forward a device ind to establish the EMU connection
* Move SolarmanEmu class into a dedicated file
* Add cloud connection counter
* Send inverter data in emulator mode
* Improve emulator mode
- parse more values from MQTT register
- differ between inverter and logger serial no
* Add some unit tests for SolarmanEmu class
* Send seconds since last sync in data packets
* Increase test coverage
* report alarm and fault bitfield to home assistant
* initial verson of message builder for SolarmanV5
- for SolarmaV5 we build he param field for the
device and inverter message from the internal
database
- added param description to the info table
for constant values, which are not parsed and
stored in internal database
* define constants for often used format strings
* update changelog