Skip to content

Commit

Permalink
update composer
Browse files Browse the repository at this point in the history
  • Loading branch information
mhzawadi committed Feb 11, 2025
1 parent 080767b commit ba25b19
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 9 deletions.
12 changes: 6 additions & 6 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions shell/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ then
docker scout cves fs://.
docker run --rm -t -v "${PWD}":/workdir overtrue/phplint:latest ./ --exclude=vendor --no-configuration --no-cache && \
docker compose -f docker-compose-dev.yml up foxess-mqtt
elif [ "$1" == "composer" ]
then
docker image rm mhzawadi/foxess-mqtt:dev-php && \
docker build -t mhzawadi/foxess-mqtt:dev-php -f Dockerfile . && \
docker run --rm -it -v '/Users/matt/git/foxess-mqtt:/foxess-mqtt' mhzawadi/foxess-mqtt:dev-php /usr/local/bin/composer update
docker compose -f docker-compose-dev.yml up -d
elif [ "$1" == "up" ]
then
docker image rm mhzawadi/foxess-mqtt:dev-php && \
Expand Down
8 changes: 5 additions & 3 deletions src/model/data.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ public function collect_data($foxess_data, $device) {
}
}

/**
* loop over every device, then
* loop over all the collected variables
* switch on unit type and post auto config to MQTT
**/
public function update_mqtt($foxess_data, $collected_data){
for( $device = 0; $device < $foxess_data['device_total']; $device++ ){ //loop over devices
$options_count = count($collected_data[$device]['result'][0]['datas']);
Expand Down Expand Up @@ -93,9 +98,6 @@ public function update_mqtt($foxess_data, $collected_data){

/**
* Process data and pass to MQTT
*
* Undocumented function long description
*
* @return return type
*/
public function process_data($mqtt_topic, $foxess_data, $collected_data, $total_over_time) {
Expand Down

0 comments on commit ba25b19

Please # to comment.