diff --git a/.github/workflows/docker-buildx-dev.yml b/.github/workflows/docker-buildx-dev.yml index 1255cc43..ca1e7034 100644 --- a/.github/workflows/docker-buildx-dev.yml +++ b/.github/workflows/docker-buildx-dev.yml @@ -43,26 +43,6 @@ jobs: run: | echo "Extracted version is: $VERSION ${{ env.VERSION }}" - - name: Run Docker Buildx on shelly - run: | - docker buildx build \ - --platform linux/arm64 \ - -f docker/Dockerfile.shelly \ - -t luligu/matterbridge:shelly \ - --push . - docker manifest inspect luligu/matterbridge:shelly - timeout-minutes: 60 - - - name: Run Docker Buildx on dev_shelly - run: | - docker buildx build \ - --platform linux/arm64 \ - -f docker/Dockerfile.dev_shelly.bookworm \ - -t luligu/matterbridge:dev_shelly \ - --push . - docker manifest inspect luligu/matterbridge:dev_shelly - timeout-minutes: 60 - - name: Run Docker Buildx on dev run: | docker buildx build \ diff --git a/.gitignore b/.gitignore index be5a6b7c..2465b076 100644 --- a/.gitignore +++ b/.gitignore @@ -39,6 +39,11 @@ replay_pid* # local migrationV8.txt migrationV8-answered.txt +matterbridgeEdge.ts +matterbridgeEdge.test.ts +matterbridgeEndpoint.ts +matterbridgeEndpoint.test.ts +matterstorage coverage TODO.md diff --git a/.npmignore b/.npmignore index ff1b8820..eb65e87a 100644 --- a/.npmignore +++ b/.npmignore @@ -201,5 +201,11 @@ test migrationV8.txt migrationV8-answered.txt +matterbridgeEdge.ts +matterbridgeEdge.test.ts +matterbridgeEndpoint.ts +matterbridgeEndpoint.test.ts +matterstorage + TODO.md CODEOWNERS \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index fcd3a324..e9d0bc15 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,7 @@ If you like this project and find it useful, please consider giving it a star on The Home Assistant Community Add-ons and plugins are not verified to work with Matterbridge. I strongly advise against using them. If you do use them and encounter an issue (which is likely because some do not meet the Matterbridge guidelines), please do not open an issue in the Matterbridge repository. -If you want to run Matterbridge in Home Assistant please use the official add-on https://github.com/Luligu/matterbridge-home-assistant-addon. +If you want to run Matterbridge in Home Assistant please use the official add-on https://github.com/Luligu/matterbridge-home-assistant-addon that also has Ingress and side panel. ### New Apple firmware v. 18.0 @@ -16,9 +16,29 @@ Please read this: https://github.com/Luligu/matterbridge/discussions/135 ### Discord -Tamer (https://github.com/tammeryousef1006) has created the Matterbridge Discord group: https://discord.gg/raWywpD4. +Tamer (https://github.com/tammeryousef1006) has created the Matterbridge Discord group: https://discord.gg/QX58CDe6hd. -Feel free to join! +Feel free to join (the link is now permanent)! + +## [1.6.0] - 2024-10-28 + +### Added + +- [matterbridge]: Added WebSocket for the Matetrbridge cockpit dashboard (Shelly gateway). + +### Changed + +- [discord]: Discord group link: https://discord.gg/QX58CDe6hd. +- [matterbridge]: Completed phase 1 of transition to edge (matter.js new API). +- [matterbridgeDevice]: Refactor Thermostat cluster method to accept minHeatSetpointLimit, maxHeatSetpointLimit, minCoolSetpointLimit and maxCoolSetpointLimit. +- [config]: The plugins config is rewritten only after onStart and no more after onConfigure (after the plugin starts is possible to change the plugins config and it will not be rewritten after the plugin configuration). +- [matterbridgeDevice]: Removed deprecated methods of ColorControl cluster. +- [package]: Removed EveHistory (it will be used only by single plugins). +- [package]: Update dependencies. + + + + ## [1.5.10] - 2024-10-01 diff --git a/README-SERVICE.md b/README-SERVICE.md index d1e97df7..be5237f0 100644 --- a/README-SERVICE.md +++ b/README-SERVICE.md @@ -100,7 +100,7 @@ sudo systemctl disable matterbridge.service ### View the log of Matterbridge in real time (this will show the log with colors) ``` -sudo journalctl -u matterbridge.service -f --output cat +sudo journalctl -u matterbridge.service -n 1000 -f --output cat ``` ### Delete the logs older then 3 days (all of them not only the ones of Matterbridge!) diff --git a/README.md b/README.md index fa617a3b..f39a6390 100644 --- a/README.md +++ b/README.md @@ -51,13 +51,13 @@ To run Matterbridge, you need either a [Node.js](https://nodejs.org/en/download/ Follow these steps to install Matterbridge: ``` -npm install -g matterbridge +npm install -g matterbridge --omit=dev ``` on Linux you may need the necessary permissions: ``` -sudo npm install -g matterbridge +sudo npm install -g matterbridge --omit=dev ``` Test the installation with: @@ -68,7 +68,7 @@ matterbridge Now it is possible to open the frontend at the link provided in the log (e.g. http://MATTERBIDGE-IPV4-ADDRESS:8283). -You can then change the bridge mode from the frontend. +You can then change the bridge mode and other parameters from the frontend. ## Usage @@ -128,19 +128,19 @@ Config editor: ### Run matterbridge as a daemon with systemctl (Linux only) -[Advanced configurations](https://github.com/Luligu/matterbridge/blob/main/README-SERVICE.md) +[Service configurations](https://github.com/Luligu/matterbridge/blob/main/README-SERVICE.md) ### Run matterbridge with docker and docker compose -[Advanced configurations](https://github.com/Luligu/matterbridge/blob/main/README-DOCKER.md) +[Docker configurations](https://github.com/Luligu/matterbridge/blob/main/README-DOCKER.md) ### Run matterbridge with podman -[Advanced configurations](https://github.com/Luligu/matterbridge/blob/main/README-PODMAN.md) +[Podman configurations](https://github.com/Luligu/matterbridge/blob/main/README-PODMAN.md) ### Run matterbridge as an home assistant add-on with the official add-on -[Advanced configurations](https://github.com/Luligu/matterbridge-home-assistant-addon) +[Home assistant add-on configurations](https://github.com/Luligu/matterbridge-home-assistant-addon) ### Other Home Assistant Community Add-ons diff --git a/TODO.md b/TODO.md index a784fb63..e47bb661 100644 --- a/TODO.md +++ b/TODO.md @@ -2,7 +2,6 @@ - OTA for matterbridge - Add test for triggerSwitchEvent configureColorControlCluster configureColorControlMode -- bug on sessions +- fix sessions with new Apple firmware - when change mode update QR immediately - -The following actions use a deprecated Node.js version and will be forced to run on node20: docker/login-action@v2. For more info: https://github.blog/changelog/2024-03-07-github-actions-all-actions-will-run-on-node20-instead-of-node16-by-default/ \ No newline at end of file +- add restart message from plugins to matterbridge frontend diff --git a/docker/Dockerfile.dev b/docker/Dockerfile.dev index 2e67f073..55e00e54 100644 --- a/docker/Dockerfile.dev +++ b/docker/Dockerfile.dev @@ -15,57 +15,47 @@ WORKDIR /app COPY ./package.json ./package-lock.json ./tsconfig.json ./.npmignore ./ COPY ./src ./src COPY ./frontend/build ./frontend/build -RUN npm ci && npm run build && npm link && npm shrinkwrap && npm pack +RUN npm ci && npm run build && npm pkg delete devDependencies && npm pkg delete scripts && npm install --omit=dev && npm link && npm shrinkwrap && npm pack WORKDIR /matterbridge-zigbee2mqtt RUN GIT_SSL_NO_VERIFY=true git clone -b dev https://github.com/Luligu/matterbridge-zigbee2mqtt.git . -COPY docker/link-matterbridge-docker-script.js ./link-matterbridge-script.js -RUN npm ci && npm run build && npm shrinkwrap && npm pack +RUN npm ci && npm link matterbridge && npm run build && npm pkg delete devDependencies && npm pkg delete scripts && npm install --omit=dev && npm shrinkwrap && npm pack WORKDIR /matterbridge-somfy-tahoma RUN GIT_SSL_NO_VERIFY=true git clone -b dev https://github.com/Luligu/matterbridge-somfy-tahoma.git . -COPY docker/link-matterbridge-docker-script.js ./link-matterbridge-script.js -RUN npm ci && npm run build && npm shrinkwrap && npm pack +RUN npm ci && npm link matterbridge && npm run build && npm pkg delete devDependencies && npm pkg delete scripts && npm install --omit=dev && npm shrinkwrap && npm pack WORKDIR /matterbridge-shelly RUN GIT_SSL_NO_VERIFY=true git clone -b dev https://github.com/Luligu/matterbridge-shelly.git . -# COPY docker/link-matterbridge-docker-script.js ./link-matterbridge-script.js -RUN npm ci && npm link matterbridge && npm run build && npm shrinkwrap && npm pack +RUN npm ci && npm link matterbridge && npm run build && npm pkg delete devDependencies && npm pkg delete scripts && npm install --omit=dev && npm shrinkwrap && npm pack WORKDIR /matterbridge-example-accessory-platform RUN GIT_SSL_NO_VERIFY=true git clone https://github.com/Luligu/matterbridge-example-accessory-platform.git . -COPY docker/link-matterbridge-docker-script.js ./link-matterbridge-script.js -RUN npm ci && npm run build && npm shrinkwrap && npm pack +RUN npm ci && npm link matterbridge && npm run build && npm pkg delete devDependencies && npm pkg delete scripts && npm install --omit=dev && npm shrinkwrap && npm pack WORKDIR /matterbridge-example-dynamic-platform RUN GIT_SSL_NO_VERIFY=true git clone https://github.com/Luligu/matterbridge-example-dynamic-platform.git . -COPY docker/link-matterbridge-docker-script.js ./link-matterbridge-script.js -RUN npm ci && npm run build && npm shrinkwrap && npm pack +RUN npm ci && npm link matterbridge && npm run build && npm pkg delete devDependencies && npm pkg delete scripts && npm install --omit=dev && npm shrinkwrap && npm pack WORKDIR /matterbridge-eve-door RUN GIT_SSL_NO_VERIFY=true git clone https://github.com/Luligu/matterbridge-eve-door.git . -COPY docker/link-matterbridge-docker-script.js ./link-matterbridge-script.js -RUN npm ci && npm run build && npm shrinkwrap && npm pack +RUN npm ci && npm link matterbridge && npm run build && npm pkg delete devDependencies && npm pkg delete scripts && npm install --omit=dev && npm shrinkwrap && npm pack WORKDIR /matterbridge-eve-motion RUN GIT_SSL_NO_VERIFY=true git clone https://github.com/Luligu/matterbridge-eve-motion.git . -COPY docker/link-matterbridge-docker-script.js ./link-matterbridge-script.js -RUN npm ci && npm run build && npm shrinkwrap && npm pack +RUN npm ci && npm link matterbridge && npm run build && npm pkg delete devDependencies && npm pkg delete scripts && npm install --omit=dev && npm shrinkwrap && npm pack WORKDIR /matterbridge-eve-energy RUN GIT_SSL_NO_VERIFY=true git clone https://github.com/Luligu/matterbridge-eve-energy.git . -COPY docker/link-matterbridge-docker-script.js ./link-matterbridge-script.js -RUN npm ci && npm run build && npm shrinkwrap && npm pack +RUN npm ci && npm link matterbridge && npm run build && npm pkg delete devDependencies && npm pkg delete scripts && npm install --omit=dev && npm shrinkwrap && npm pack WORKDIR /matterbridge-eve-room RUN GIT_SSL_NO_VERIFY=true git clone https://github.com/Luligu/matterbridge-eve-room.git . -COPY docker/link-matterbridge-docker-script.js ./link-matterbridge-script.js -RUN npm ci && npm run build && npm shrinkwrap && npm pack +RUN npm ci && npm link matterbridge && npm run build && npm pkg delete devDependencies && npm pkg delete scripts && npm install --omit=dev && npm shrinkwrap && npm pack WORKDIR /matterbridge-eve-weather RUN GIT_SSL_NO_VERIFY=true git clone https://github.com/Luligu/matterbridge-eve-weather.git . -COPY docker/link-matterbridge-docker-script.js ./link-matterbridge-script.js -RUN npm ci && npm run build && npm shrinkwrap && npm pack +RUN npm ci && npm link matterbridge && npm run build && npm pkg delete devDependencies && npm pkg delete scripts && npm install --omit=dev && npm shrinkwrap && npm pack @@ -85,6 +75,6 @@ COPY --from=builder /matterbridge-eve-motion/*.tgz . COPY --from=builder /matterbridge-eve-energy/*.tgz . COPY --from=builder /matterbridge-eve-room/*.tgz . COPY --from=builder /matterbridge-eve-weather/*.tgz . -RUN npm install -g --omit=dev *.tgz && rm *.tgz && node -v && npm -v && npm list -g +RUN npm install -g --omit=dev *.tgz && rm *.tgz && node -v && npm -v && npm list -g && npm cache clean --force && rm -rf /tmp/* /var/tmp/* /root/.npm /root/.cache && apt-get clean && rm -rf /var/lib/apt/lists/* CMD ["matterbridge", "-docker"] diff --git a/frontend/build/asset-manifest.json b/frontend/build/asset-manifest.json index 7f41b743..6e27e2ae 100644 --- a/frontend/build/asset-manifest.json +++ b/frontend/build/asset-manifest.json @@ -1,15 +1,15 @@ { "files": { "main.css": "./static/css/main.1cf003ae.css", - "main.js": "./static/js/main.96d6324b.js", + "main.js": "./static/js/main.045d08f7.js", "static/js/453.abd36b29.chunk.js": "./static/js/453.abd36b29.chunk.js", "index.html": "./index.html", "main.1cf003ae.css.map": "./static/css/main.1cf003ae.css.map", - "main.96d6324b.js.map": "./static/js/main.96d6324b.js.map", + "main.045d08f7.js.map": "./static/js/main.045d08f7.js.map", "453.abd36b29.chunk.js.map": "./static/js/453.abd36b29.chunk.js.map" }, "entrypoints": [ "static/css/main.1cf003ae.css", - "static/js/main.96d6324b.js" + "static/js/main.045d08f7.js" ] } \ No newline at end of file diff --git a/frontend/build/index.html b/frontend/build/index.html index cfde3c8d..9bee1e7f 100644 --- a/frontend/build/index.html +++ b/frontend/build/index.html @@ -1 +1 @@ -
-1;)f!==e&&l.call(f,h,1),l.call(e,h,1);return e}},66487:e=>{e.exports=function(e,t,r,n,o){return o(e,(function(e,o,a){r=n?(n=!1,e):t(r,e,o,a)})),r}},55647:(e,t,r)=>{var n=r(33279),o=r(55636),a=r(46350);e.exports=function(e,t){return a(o(e,t,n),e+"")}},9261:(e,t,r)=>{var n=r(78420),o=r(35324),a=r(69194),i=r(46686),s=r(70914);e.exports=function(e,t,r,l){if(!i(e))return e;for(var c=-1,u=(t=o(t,e)).length,d=u-1,p=e;null!=p&&++c{var n=r(22541),o=r(5654),a=r(33279),i=o?function(e,t){return o(e,"toString",{configurable:!0,enumerable:!1,value:n(t),writable:!0})}:a;e.exports=i},53871:e=>{e.exports=function(e,t,r){var n=-1,o=e.length;t<0&&(t=-t>o?0:o+t),(r=r>o?o:r)<0&&(r+=o),o=t>r?0:r-t>>>0,t>>>=0;for(var a=Array(o);++n=l?c:c*("desc"==r[o]?-1:1)}return e.index-t.index}},91980:e=>{e.exports=function(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r{var n=r(52969),o=r(53871);e.exports=function(e,t){return t.length<2?e:n(e,o(t,0,-1))}},56552:(e,t,r)=>{var n=r(37105),o="object"==typeof self&&self&&self.Object===Object&&self,a=n||o||Function("return this")();e.exports=a},53737:e=>{e.exports=function(e,t){if(("constructor"!==t||"function"!==typeof e[t])&&"__proto__"!=t)return e[t]}},86179:e=>{e.exports=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this}},46704:e=>{e.exports=function(e){return this.__data__.has(e)}},52074:e=>{e.exports=function(e){var t=-1,r=Array(e.size);return e.forEach((function(e){r[++t]=e})),r}},46350:(e,t,r)=>{var n=r(28325),o=r(86578)(n);e.exports=o},86578:e=>{var t=Date.now;e.exports=function(e){var r=0,n=0;return function(){var o=t(),a=16-(o-n);if(n=o,a>0){if(++r>=800)return arguments[0]}else r=0;return e.apply(void 0,arguments)}}},84545:(e,t,r)=>{var n=r(97160);e.exports=function(){this.__data__=new n,this.size=0}},10793:e=>{e.exports=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}},27760:e=>{e.exports=function(e){return this.__data__.get(e)}},3892:e=>{e.exports=function(e){return this.__data__.has(e)}},76788:(e,t,r)=>{var n=r(97160),o=r(85204),a=r(64816);e.exports=function(e,t){var r=this.__data__;if(r instanceof n){var i=r.__data__;if(!o||i.length<199)return i.push([e,t]),this.size=++r.size,this;r=this.__data__=new a(i)}return r.set(e,t),this.size=r.size,this}},94020:e=>{e.exports=function(e,t,r){for(var n=r-1,o=e.length;++n%1
.",e.UnsupportedFieldWithReason="Unsupported field schema: %1.",e.UnsupportedFieldWithIdAndReason="Unsupported field schema for field %1
: %2.",e.FilesInfo="**%1** (%2, %3 bytes)"}(df||(df={}));r(55491);var yf=r(22616),bf=r.n(yf);let xf=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:21;return crypto.getRandomValues(new Uint8Array(e)).reduce(((e,t)=>e+=(t&=63)<36?t.toString(36):t<62?(t-26).toString(36).toUpperCase():t>62?"-":"_"),"")};function wf(){return xf()}function Sf(e){return Array.isArray(e)?e.map((e=>({key:wf(),item:e}))):[]}function Af(e){return Array.isArray(e)?e.map((e=>e.item)):[]}class kf extends t.Component{constructor(e){super(e),this._getNewFormDataRow=()=>{const{schema:e,registry:t}=this.props,{schemaUtils:r}=t;let n=e.items;return up(e)&&function(e){return!0===e.additionalItems&&console.warn("additionalItems=true is currently not supported"),Pu(e.additionalItems)}(e)&&(n=e.additionalItems),r.getDefaultFormState(n)},this.onAddClick=e=>{this._handleAddClick(e)},this.onAddIndexClick=e=>t=>{this._handleAddClick(t,e)},this.onCopyIndexClick=e=>t=>{t&&t.preventDefault();const{onChange:r,errorSchema:n}=this.props,{keyedFormData:o}=this.state;let a;if(n){a={};for(const t in n){const r=parseInt(t);r<=e?Md()(a,[r],n[t]):r>e&&Md()(a,[r+1],n[t])}}const i={key:wf(),item:zp()(o[e].item)},s=[...o];void 0!==e?s.splice(e+1,0,i):s.push(i),this.setState({keyedFormData:s,updatedKeyedFormData:!0},(()=>r(Af(s),a)))},this.onDropIndexClick=e=>t=>{t&&t.preventDefault();const{onChange:r,errorSchema:n}=this.props,{keyedFormData:o}=this.state;let a;if(n){a={};for(const t in n){const r=parseInt(t);r{"use strict";e.exports=function e(t,r){if(t===r)return!0;if(t&&r&&"object"==typeof t&&"object"==typeof r){if(t.constructor!==r.constructor)return!1;var n,o,a;if(Array.isArray(t)){if((n=t.length)!=r.length)return!1;for(o=n;0!==o--;)if(!e(t[o],r[o]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if((n=(a=Object.keys(t)).length)!==Object.keys(r).length)return!1;for(o=n;0!==o--;)if(!Object.prototype.hasOwnProperty.call(r,a[o]))return!1;for(o=n;0!==o--;){var i=a[o];if(!e(t[i],r[i]))return!1}return!0}return t!==t&&r!==r}},80219:(e,t,r)=>{"use strict";var n=r(53763),o={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},a={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},i={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};function l(e){return n.isMemo(e)?i:s[e.$$typeof]||o}s[n.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},s[n.Memo]=i;var c=Object.defineProperty,u=Object.getOwnPropertyNames,d=Object.getOwnPropertySymbols,p=Object.getOwnPropertyDescriptor,f=Object.getPrototypeOf,h=Object.prototype;e.exports=function e(t,r,n){if("string"!==typeof r){if(h){var o=f(r);o&&o!==h&&e(t,o,n)}var i=u(r);d&&(i=i.concat(d(r)));for(var s=l(t),m=l(r),g=0;g