├── .github ├── ISSUE_TEMPLATE │ ├── bug_report.md │ └── feature_request.md ├── auto-merge.yml ├── dependabot.yml ├── stale.yml └── workflows │ ├── codeql.yml │ ├── dependabot-auto-merge.yml │ └── test-and-release.yml ├── .gitignore ├── .mocharc.json ├── .releaseconfig.json ├── LICENSE ├── README.md ├── admin ├── asset-manifest.json ├── favicon.ico ├── langModel.js ├── manifest.json ├── static │ ├── css │ │ ├── main.9a2887fc.css │ │ └── main.9a2887fc.css.map │ ├── js │ │ ├── main.5451832d.js │ │ ├── main.5451832d.js.LICENSE.txt │ │ └── main.5451832d.js.map │ └── media │ │ ├── Alarm Systems.857ab9a8f90827777b88.svg │ │ ├── Amplifier.6f5d18048328386033f8.svg │ │ ├── Anteroom.93a742135f2c060ad619.svg │ │ ├── Attic.bb5d690a160bb1d4edb2.svg │ │ ├── Awnings.78480df8796f09859b6a.svg │ │ ├── Balcony.2f76ef0877aaa3bd2ff7.svg │ │ ├── Barn.5d839e84c80918ce2ef0.svg │ │ ├── Basement.fe636968eec9556bfd1f.svg │ │ ├── Bathroom.27a777c66183f9f613db.svg │ │ ├── Battery Status.5951e2078ae1e573510e.svg │ │ ├── Bedroom.2a16d8d98fafe965fd1b.svg │ │ ├── Boiler Room.548e785e2f92b45f72b3.svg │ │ ├── Carport.8337662544b9e95f4b27.svg │ │ ├── Ceiling Spotlights.485822441b5df3b3384a.svg │ │ ├── Cellar.7ec1b1803a2437c8b78c.svg │ │ ├── Chamber.71daaa4d14262dae029b.svg │ │ ├── Chandelier.8b9fbdbc73bc2e955ef7.svg │ │ ├── Climate.b7e9896e7f103360bb5a.svg │ │ ├── Coffee Makers.9fb4d82f957a06f30dae.svg │ │ ├── Cold Water.937aad5fa21b0c20a856.svg │ │ ├── Computer.9558f6ee3941dba4e3c5.svg │ │ ├── Consumption.fecd7a10a13fe4e5f69b.svg │ │ ├── Corridor.93a742135f2c060ad619.svg │ │ ├── Curtains.955e213206d2073eef99.svg │ │ ├── Dining Area.14dfc38cbb4fe041e9da.svg │ │ ├── Dining Room.14dfc38cbb4fe041e9da.svg │ │ ├── Dining.14dfc38cbb4fe041e9da.svg │ │ ├── Dishwashers.3709566b7214596236b7.svg │ │ ├── Doors.d59bf859f582d3488a04.svg │ │ ├── Doorstep.10630b759b4867a10776.svg │ │ ├── Dressing Room.5e6f8f64b0e8f91c473e.svg │ │ ├── Driveway.fbd31101c5a80a8bb37a.svg │ │ ├── Dryer.5ea89bd6dc20a00fb442.svg │ │ ├── Entrance.4c1404056847caf959b6.svg │ │ ├── Equipment Room.db92bdca64f653c844f8.svg │ │ ├── Fan.8a29f85d6ca99c584603.svg │ │ ├── Floor Lamps.471e0bcf308d94963504.svg │ │ ├── Front Yard.af9ce2d89aa4d7a9363e.svg │ │ ├── Gallery.4e7f9433fae8b24fdfca.svg │ │ ├── Garage Doors.0c2a1cfca7ad1ea59625.svg │ │ ├── Garage.f7fc0a9b326d582afee6.svg │ │ ├── Garden.51c2e94f62a74e20775d.svg │ │ ├── Gates.5a8baf2c3d4832ca57e8.svg │ │ ├── Ground Floor.2b7c5c91db7f070935a2.svg │ │ ├── Guest Bathroom.d07a9f1cf32a82d03267.svg │ │ ├── Guest Room.41c7cfa38806f5009f82.svg │ │ ├── Gym.7a0d22127ea3f557228a.svg │ │ ├── Hairdryer.5960b514dac1f04f3c4d.svg │ │ ├── Hall.9c2fa95419cb84ecda68.svg │ │ ├── Handle.3de1d1320fc3ce2f9712.svg │ │ ├── Hanging Lamps.0bd452fc843edd645c30.svg │ │ ├── Heater.b53bccc334bbb9238a36.svg │ │ ├── Home Theater.1e5f19a0b2a013f153f5.svg │ │ ├── Hoods.c177ddfec9fa9a6335db.svg │ │ ├── Hot Water.5c0a9e01741562e1fbab.svg │ │ ├── Humidity.6d58f69cf268dd8a8ac1.svg │ │ ├── Iron.b8a65a48503b6f3e0dc8.svg │ │ ├── Irrigation.da57e9df479035d5d7f0.svg │ │ ├── Kitchen.deb7f976c1f43f9039a2.svg │ │ ├── Laundry Room.58da550dff0173676e02.svg │ │ ├── Led Strip.5cf2de461e29ffbaa5f0.svg │ │ ├── Light.21f1a5dfcc93f8ba1214.svg │ │ ├── Lightings.658080eb8c0e347cd152.svg │ │ ├── Living Area.1c29b81e75b75e3310db.svg │ │ ├── Living Room.3c380ab767be35f904e1.svg │ │ ├── Lock.2cbfe17ea8923e0f4e9e.svg │ │ ├── Locker Room.1e381bdf34bfce551d73.svg │ │ ├── Louvre.75b84cd3d39d68107807.svg │ │ ├── Mowing Machine.9ead5b039f36cdc800e6.svg │ │ ├── Music.67bc6063cb601642fd74.svg │ │ ├── Nursery.9cecc0544bdb5c28500c.svg │ │ ├── Office.7e6a38218390b655e270.svg │ │ ├── Outdoor Blinds.37b85a9c060a4af48da9.svg │ │ ├── Outdoors.da42e64a4b6ec2dd1e1c.svg │ │ ├── People.12a7e9127e72f3259186.svg │ │ ├── Playroom.e64c9de43030c28d2f96.svg │ │ ├── Pool.9452c0f84f53c7836f3d.svg │ │ ├── Power Consumption.4faab614c3c788f2d338.svg │ │ ├── Printer.146d983be964b95745d2.svg │ │ ├── Pump.a6035507cddbe7db5f6a.svg │ │ ├── Rear Wall.38843c33f1ea1f575500.svg │ │ ├── Receiver.26b5ae166395a6dcb83f.svg │ │ ├── Sconces.9bf4c2f7a209085207aa.svg │ │ ├── Second Floor.a2d5ed32df336591c06b.svg │ │ ├── Security.1ec78971bd34efa950f8.svg │ │ ├── Shading.0577383dc227cd043b3d.svg │ │ ├── Shed.491a2ad372036118002c.svg │ │ ├── Shutters.db7d7b0d498f40779210.svg │ │ ├── Sleeping Area.828017602bfcc2dd7dce.svg │ │ ├── SmokeDetector.8222f77cb07030a409ee.svg │ │ ├── Sockets.8320e1a99be9de004629.svg │ │ ├── Speaker.db548379676317470c4f.svg │ │ ├── Stairway.9b007e08605296110003.svg │ │ ├── Stairwell.0914feea948153a8637a.svg │ │ ├── Storeroom.7de4e6f3364554459b8a.svg │ │ ├── Stove.d0f68b3e138c5831d252.svg │ │ ├── Summer House.541a9fec69f01105e244.svg │ │ ├── Swimming Pool.190b378cb0707edb9461.svg │ │ ├── Table Lamps.bd92de33bf86b6cbaec9.svg │ │ ├── Temperature Sensors.75d805988a6b77b231d8.svg │ │ ├── Terrace.d71d07d9290674f2ca20.svg │ │ ├── Toilet.83604dd2daafb67067dd.svg │ │ ├── Tv.4e9745a548e57bfac0c7.svg │ │ ├── Upstairs.441813e54e0daca0882d.svg │ │ ├── Vacuum Cleaner.9c8d50e436e6cea06dfa.svg │ │ ├── Ventilation.c31761d86d67e245ac92.svg │ │ ├── Wardrobe.e8019970a2b51412cfdc.svg │ │ ├── Washing Machines.577f3acdb3cef002b523.svg │ │ ├── Washroom.bfb54196f381f36de9d6.svg │ │ ├── Water Consumption.68891649591cc2434c5b.svg │ │ ├── Water Heater.7e4bb4d99a5213f24d08.svg │ │ ├── Water.f50411984c5c24fa574d.svg │ │ ├── Wc.83604dd2daafb67067dd.svg │ │ ├── Weather.e91dae647698d48365e3.svg │ │ ├── Window.421664f57c35e5109aa2.svg │ │ ├── Windscreen.6058448bf63f72dd5036.svg │ │ ├── Workshop.7856e59fe4f164c90609.svg │ │ ├── Workspace.97d73e419d966bfb6428.svg │ │ ├── names.3a7dae0bd6b8b03b280f.txt │ │ └── names.e7efb5283d98000c74ac.txt ├── style.css ├── tab_m.html └── text2command.png ├── gulpfile.js ├── img └── enums.png ├── io-package.json ├── lib ├── devicesControl.js ├── formatProvider.js ├── functions.js ├── langModel.js ├── rooms.js ├── simpleAnswers.js └── simpleControl.js ├── main.js ├── package.json ├── src ├── .eslintrc.js ├── .gitignore ├── README.md ├── package.json ├── public │ ├── favicon.ico │ ├── index.html │ ├── langModel.js │ ├── manifest.json │ ├── style.css │ └── text2command.png └── src │ ├── App.js │ ├── assets │ └── text2command.png │ ├── components │ ├── CreateRuleDialog.js │ ├── Drawer.js │ ├── Layout.js │ ├── Rule.js │ ├── RuleEditor.js │ └── SettingsDialog.js │ ├── i18n │ ├── de.json │ ├── en.json │ ├── es.json │ ├── fr.json │ ├── it.json │ ├── nl.json │ ├── pl.json │ ├── pt.json │ ├── ru.json │ ├── uk.json │ └── zh-cn.json │ ├── index.css │ ├── index.js │ └── serviceWorker.js └── test ├── lib ├── setup.js └── testData.json ├── mocha.setup.js ├── testBindings.js ├── testCommands.js ├── testComplex.js ├── testFormatProvider.js └── testPackageFiles.js /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Something is not working as it should 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | --- 8 | 9 | **Describe the bug** 10 | A clear and concise description of what the bug is. 11 | 12 | **To Reproduce** 13 | Steps to reproduce the behavior: 14 | 1. Go to '...' 15 | 2. Click on '...' 16 | 3. Scroll down to '....' 17 | 4. See error 18 | 19 | **Expected behavior** 20 | A clear and concise description of what you expected to happen. 21 | 22 | **Screenshots & Logfiles** 23 | If applicable, add screenshots and logfiles to help explain your problem. 24 | 25 | **Versions:** 26 | - Adapter version: 27 | - JS-Controller version: 28 | - Node version: 29 | - Operating system: 30 | 31 | **Additional context** 32 | Add any other context about the problem here. 33 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /.github/auto-merge.yml: -------------------------------------------------------------------------------- 1 | # Configure here which dependency updates should be merged automatically. 2 | # The recommended configuration is the following: 3 | - match: 4 | # Only merge patches for production dependencies 5 | dependency_type: production 6 | update_type: "semver:patch" 7 | - match: 8 | # Except for security fixes, here we allow minor patches 9 | dependency_type: production 10 | update_type: "security:minor" 11 | - match: 12 | # and development dependencies can have a minor update, too 13 | dependency_type: development 14 | update_type: "semver:minor" 15 | 16 | # The syntax is based on the legacy dependabot v1 automerged_updates syntax, see: 17 | # https://dependabot.com/docs/config-file/#automerged_updates -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: github-actions 4 | directory: "/" 5 | schedule: 6 | interval: monthly 7 | time: "04:00" 8 | timezone: Europe/Berlin 9 | - package-ecosystem: npm 10 | directory: "/" 11 | schedule: 12 | interval: weekly 13 | open-pull-requests-limit: 10 14 | versioning-strategy: increase 15 | - package-ecosystem: npm 16 | directory: "/src" 17 | schedule: 18 | interval: monthly 19 | time: "04:00" 20 | timezone: Europe/Berlin 21 | open-pull-requests-limit: 20 22 | versioning-strategy: increase -------------------------------------------------------------------------------- /.github/stale.yml: -------------------------------------------------------------------------------- 1 | # Configuration for probot-stale - https://github.com/probot/stale 2 | 3 | # Number of days of inactivity before an Issue or Pull Request becomes stale 4 | daysUntilStale: 90 5 | 6 | # Number of days of inactivity before an Issue or Pull Request with the stale label is closed. 7 | # Set to false to disable. If disabled, issues still need to be closed manually, but will remain marked as stale. 8 | daysUntilClose: 7 9 | 10 | # Only issues or pull requests with all of these labels are check if stale. Defaults to `[]` (disabled) 11 | onlyLabels: [] 12 | 13 | # Issues or Pull Requests with these labels will never be considered stale. Set to `[]` to disable 14 | exemptLabels: 15 | - enhancement 16 | - security 17 | 18 | # Set to true to ignore issues in a project (defaults to false) 19 | exemptProjects: true 20 | 21 | # Set to true to ignore issues in a milestone (defaults to false) 22 | exemptMilestones: true 23 | 24 | # Set to true to ignore issues with an assignee (defaults to false) 25 | exemptAssignees: false 26 | 27 | # Label to use when marking as stale 28 | staleLabel: wontfix 29 | 30 | # Comment to post when marking as stale. Set to `false` to disable 31 | markComment: > 32 | This issue has been automatically marked as stale because it has not had 33 | recent activity. It will be closed if no further activity occurs within the next 7 days. 34 | Please check if the issue is still relevant in the most current version of the adapter 35 | and tell us. Also check that all relevant details, logs and reproduction steps 36 | are included and update them if needed. 37 | Thank you for your contributions. 38 | 39 | Dieses Problem wurde automatisch als veraltet markiert, da es in letzter Zeit keine Aktivitäten gab. 40 | Es wird geschlossen, wenn nicht innerhalb der nächsten 7 Tage weitere Aktivitäten stattfinden. 41 | Bitte überprüft, ob das Problem auch in der aktuellsten Version des Adapters noch relevant ist, 42 | und teilt uns dies mit. Überprüft auch, ob alle relevanten Details, Logs und Reproduktionsschritte 43 | enthalten sind bzw. aktualisiert diese. 44 | Vielen Dank für Eure Unterstützung. 45 | 46 | # Comment to post when removing the stale label. 47 | # unmarkComment: > 48 | # Your comment here. 49 | 50 | # Comment to post when closing a stale Issue or Pull Request. 51 | closeComment: > 52 | This issue has been automatically closed because of inactivity. Please open a new 53 | issue if still relevant and make sure to include all relevant details, logs and 54 | reproduction steps. 55 | Thank you for your contributions. 56 | 57 | Dieses Problem wurde aufgrund von Inaktivität automatisch geschlossen. Bitte öffnet ein 58 | neues Issue, falls dies noch relevant ist und stellt sicher das alle relevanten Details, 59 | Logs und Reproduktionsschritte enthalten sind. 60 | Vielen Dank für Eure Unterstützung. 61 | 62 | # Limit the number of actions per hour, from 1-30. Default is 30 63 | limitPerRun: 30 64 | 65 | # Limit to only `issues` or `pulls` 66 | only: issues 67 | 68 | # Optionally, specify configuration settings that are specific to just 'issues' or 'pulls': 69 | # pulls: 70 | # daysUntilStale: 30 71 | # markComment: > 72 | # This pull request has been automatically marked as stale because it has not had 73 | # recent activity. It will be closed if no further activity occurs. Thank you 74 | # for your contributions. 75 | 76 | # issues: 77 | # exemptLabels: 78 | # - confirmed -------------------------------------------------------------------------------- /.github/workflows/codeql.yml: -------------------------------------------------------------------------------- 1 | name: "CodeQL" 2 | 3 | on: 4 | push: 5 | branches: [ "master" ] 6 | pull_request: 7 | branches: [ "master" ] 8 | schedule: 9 | - cron: "19 19 * * 0" 10 | 11 | jobs: 12 | analyze: 13 | name: Analyze 14 | runs-on: ubuntu-latest 15 | permissions: 16 | actions: read 17 | contents: read 18 | security-events: write 19 | 20 | strategy: 21 | fail-fast: false 22 | matrix: 23 | language: [ javascript ] 24 | 25 | steps: 26 | - name: Checkout 27 | uses: actions/checkout@v4 28 | 29 | - name: Initialize CodeQL 30 | uses: github/codeql-action/init@v2 31 | with: 32 | languages: ${{ matrix.language }} 33 | queries: +security-and-quality 34 | 35 | - name: Autobuild 36 | uses: github/codeql-action/autobuild@v2 37 | 38 | - name: Perform CodeQL Analysis 39 | uses: github/codeql-action/analyze@v2 40 | with: 41 | category: "/language:${{ matrix.language }}" 42 | -------------------------------------------------------------------------------- /.github/workflows/dependabot-auto-merge.yml: -------------------------------------------------------------------------------- 1 | # Automatically merge Dependabot PRs when version comparison is within the range 2 | # that is configured in .github/auto-merge.yml 3 | 4 | name: Auto-Merge Dependabot PRs 5 | 6 | on: 7 | pull_request_target: 8 | 9 | jobs: 10 | auto-merge: 11 | runs-on: ubuntu-latest 12 | steps: 13 | - name: Checkout code 14 | uses: actions/checkout@v4 15 | 16 | - name: Check if PR should be auto-merged 17 | uses: ahmadnassri/action-dependabot-auto-merge@v2 18 | with: 19 | # This must be a personal access token with push access 20 | github-token: ${{ secrets.AUTO_MERGE_TOKEN }} 21 | # By default, squash and merge, so Github chooses nice commit messages 22 | command: squash and merge 23 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .idea 3 | tmp 4 | admin/i18n/flat.txt 5 | admin/i18n/*/flat.txt 6 | iob_npm.done 7 | package-lock.json -------------------------------------------------------------------------------- /.mocharc.json: -------------------------------------------------------------------------------- 1 | { 2 | "require": [ 3 | "./test/mocha.setup.js" 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /.releaseconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "plugins": ["iobroker", "license"], 3 | "exec": { 4 | "before_commit": "npm run build" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016-2023, Bluefox (dogafox@gmail.com) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /admin/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ioBroker/ioBroker.text2command/36a43b866098d2ea913a47feb531efb8f9ef7e1d/admin/favicon.ico -------------------------------------------------------------------------------- /admin/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "Consumption", 3 | "name": "ioBroker Consumption Configuration", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | } 10 | ], 11 | "start_url": ".", 12 | "display": "standalone", 13 | "theme_color": "#000000", 14 | "background_color": "#ffffff" 15 | } 16 | -------------------------------------------------------------------------------- /admin/static/css/main.9a2887fc.css: -------------------------------------------------------------------------------- 1 | body,html{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;height:100%;margin:0;overflow:hidden;padding:0;width:100%}::-webkit-scrollbar,::-webkit-scrollbar-track{background-color:#ccc}::-webkit-scrollbar{width:6px}::-webkit-scrollbar-thumb{background-color:#575757}#root{height:100%}.App{height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;min-height:100%}.splitter-layout{display:flex;flex-direction:row;height:100%;overflow:hidden;position:absolute;width:100%}.splitter-layout .layout-pane{flex:0 0 auto;overflow:auto;position:relative}.splitter-layout .layout-pane.layout-pane-primary{flex:1 1 auto}.splitter-layout>.layout-splitter{background-color:#ccc;cursor:col-resize;flex:0 0 auto;height:100%;width:4px}.splitter-layout .layout-splitter:hover{background-color:#bbb}.splitter-layout.layout-changing{cursor:col-resize}.splitter-layout.layout-changing>.layout-splitter{background-color:#aaa}.splitter-layout.splitter-layout-vertical{flex-direction:column}.splitter-layout.splitter-layout-vertical.layout-changing{cursor:row-resize}.splitter-layout.splitter-layout-vertical>.layout-splitter{cursor:row-resize;height:4px;width:100%} 2 | /*# sourceMappingURL=main.9a2887fc.css.map*/ -------------------------------------------------------------------------------- /admin/static/css/main.9a2887fc.css.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"static/css/main.9a2887fc.css","mappings":"AAAA,UAKI,mIAA8J,CAD9J,WAAY,CAHZ,QAAS,CAKT,eAAe,CAJf,SAAU,CACV,UAIJ,CAKA,8CAFI,qBAKJ,CAHA,oBACI,SAEJ,CACA,0BACI,wBACJ,CAEA,MACI,WACJ,CACA,KAEI,0BAA2B,CAC3B,uBAAwB,CACxB,kBAAmB,CAHnB,eAIJ,CC5BA,iBAEE,YAAa,CACb,kBAAmB,CAEnB,WAAY,CACZ,eAAgB,CALhB,iBAAkB,CAGlB,UAGF,CAEA,8BAEE,aAAc,CACd,aAAc,CAFd,iBAGF,CAEA,kDACE,aACF,CAEA,kCAKE,qBAAsB,CADtB,iBAAkB,CAHlB,aAAc,CAEd,WAAY,CADZ,SAIF,CAEA,wCACE,qBACF,CAEA,iCACE,iBACF,CAEA,kDACE,qBACF,CAEA,0CACE,qBACF,CAEA,0DACE,iBACF,CAEA,2DAGE,iBAAkB,CADlB,UAAW,CADX,UAGF","sources":["index.css","../node_modules/react-splitter-layout/lib/index.css"],"sourcesContent":["body, html {\r\n margin: 0;\r\n padding: 0;\r\n width: 100%;\r\n height: 100%;\r\n font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", \"Roboto\", \"Oxygen\", \"Ubuntu\", \"Cantarell\", \"Fira Sans\", \"Droid Sans\", \"Helvetica Neue\", sans-serif;\r\n overflow: hidden\r\n}\r\n/* scrollbar */\r\n*::-webkit-scrollbar-track {\r\n background-color: #ccc;\r\n}\r\n*::-webkit-scrollbar {\r\n width: 6px;\r\n background-color: #ccc;\r\n}\r\n*::-webkit-scrollbar-thumb {\r\n background-color: #575757;\r\n}\r\n\r\n#root {\r\n height: 100%;\r\n}\r\n.App {\r\n min-height: 100%;\r\n height: -webkit-fit-content;\r\n height: -moz-fit-content;\r\n height: fit-content;\r\n}\r\n\r\n/* Right side */\r\n\r\n/* Media */\r\n\r\n/* @media screen and (max-width: 900px) {\r\n .right-bar__container {\r\n width: 80%;\r\n }\r\n .right-bar {\r\n padding: 0 10px;\r\n }\r\n}\r\n\r\n@media screen and (max-width: 530px) {\r\n .custom-card {\r\n flex-direction: column;\r\n }\r\n .right-bar .MuiFormControl-root {\r\n align-self: flex-start;\r\n margin-top: 10px;\r\n }\r\n}\r\n\r\n@media screen and (max-width: 400px) {\r\n} */\r\n\r\n/* Media */\r\n",".splitter-layout {\n position: absolute;\n display: flex;\n flex-direction: row;\n width: 100%;\n height: 100%;\n overflow: hidden;\n}\n\n.splitter-layout .layout-pane {\n position: relative;\n flex: 0 0 auto;\n overflow: auto;\n}\n\n.splitter-layout .layout-pane.layout-pane-primary {\n flex: 1 1 auto;\n}\n\n.splitter-layout > .layout-splitter {\n flex: 0 0 auto;\n width: 4px;\n height: 100%;\n cursor: col-resize;\n background-color: #ccc;\n}\n\n.splitter-layout .layout-splitter:hover {\n background-color: #bbb;\n}\n\n.splitter-layout.layout-changing {\n cursor: col-resize;\n}\n\n.splitter-layout.layout-changing > .layout-splitter {\n background-color: #aaa;\n}\n\n.splitter-layout.splitter-layout-vertical {\n flex-direction: column;\n}\n\n.splitter-layout.splitter-layout-vertical.layout-changing {\n cursor: row-resize;\n}\n\n.splitter-layout.splitter-layout-vertical > .layout-splitter {\n width: 100%;\n height: 4px;\n cursor: row-resize;\n}\n"],"names":[],"sourceRoot":""} -------------------------------------------------------------------------------- /admin/static/media/Amplifier.6f5d18048328386033f8.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /admin/static/media/Attic.bb5d690a160bb1d4edb2.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /admin/static/media/Awnings.78480df8796f09859b6a.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /admin/static/media/Barn.5d839e84c80918ce2ef0.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /admin/static/media/Basement.fe636968eec9556bfd1f.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /admin/static/media/Battery Status.5951e2078ae1e573510e.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /admin/static/media/Bedroom.2a16d8d98fafe965fd1b.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /admin/static/media/Boiler Room.548e785e2f92b45f72b3.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /admin/static/media/Carport.8337662544b9e95f4b27.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /admin/static/media/Ceiling Spotlights.485822441b5df3b3384a.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /admin/static/media/Chamber.71daaa4d14262dae029b.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /admin/static/media/Coffee Makers.9fb4d82f957a06f30dae.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /admin/static/media/Cold Water.937aad5fa21b0c20a856.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 12 | 21 | 24 | 27 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /admin/static/media/Computer.9558f6ee3941dba4e3c5.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 15 | 18 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /admin/static/media/Consumption.fecd7a10a13fe4e5f69b.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /admin/static/media/Doors.d59bf859f582d3488a04.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /admin/static/media/Doorstep.10630b759b4867a10776.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 8 | 11 | 14 | 17 | 20 | 23 | 25 | 28 | 30 | 32 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /admin/static/media/Dryer.5ea89bd6dc20a00fb442.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /admin/static/media/Fan.8a29f85d6ca99c584603.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /admin/static/media/Floor Lamps.471e0bcf308d94963504.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /admin/static/media/Garage Doors.0c2a1cfca7ad1ea59625.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /admin/static/media/Garage.f7fc0a9b326d582afee6.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 13 | 15 | 17 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /admin/static/media/Gates.5a8baf2c3d4832ca57e8.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 23 | 25 | 27 | 29 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /admin/static/media/Guest Bathroom.d07a9f1cf32a82d03267.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /admin/static/media/Guest Room.41c7cfa38806f5009f82.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /admin/static/media/Hairdryer.5960b514dac1f04f3c4d.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 14 | 17 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /admin/static/media/Hall.9c2fa95419cb84ecda68.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 9 | 10 | 11 | 13 | 14 | 16 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /admin/static/media/Handle.3de1d1320fc3ce2f9712.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /admin/static/media/Hanging Lamps.0bd452fc843edd645c30.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /admin/static/media/Hoods.c177ddfec9fa9a6335db.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /admin/static/media/Hot Water.5c0a9e01741562e1fbab.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /admin/static/media/Iron.b8a65a48503b6f3e0dc8.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /admin/static/media/Kitchen.deb7f976c1f43f9039a2.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /admin/static/media/Laundry Room.58da550dff0173676e02.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /admin/static/media/Led Strip.5cf2de461e29ffbaa5f0.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /admin/static/media/Living Room.3c380ab767be35f904e1.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /admin/static/media/Lock.2cbfe17ea8923e0f4e9e.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 12 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /admin/static/media/Mowing Machine.9ead5b039f36cdc800e6.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /admin/static/media/Nursery.9cecc0544bdb5c28500c.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /admin/static/media/Office.7e6a38218390b655e270.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /admin/static/media/Outdoor Blinds.37b85a9c060a4af48da9.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /admin/static/media/Outdoors.da42e64a4b6ec2dd1e1c.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /admin/static/media/People.12a7e9127e72f3259186.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /admin/static/media/Playroom.e64c9de43030c28d2f96.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /admin/static/media/Power Consumption.4faab614c3c788f2d338.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /admin/static/media/Printer.146d983be964b95745d2.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /admin/static/media/Rear Wall.38843c33f1ea1f575500.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 25 | 27 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /admin/static/media/Receiver.26b5ae166395a6dcb83f.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /admin/static/media/Shading.0577383dc227cd043b3d.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /admin/static/media/Shed.491a2ad372036118002c.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 8 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /admin/static/media/Sleeping Area.828017602bfcc2dd7dce.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 15 | 17 | 19 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /admin/static/media/SmokeDetector.8222f77cb07030a409ee.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /admin/static/media/Sockets.8320e1a99be9de004629.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 8 | 10 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /admin/static/media/Speaker.db548379676317470c4f.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 10 | 13 | 16 | 18 | 19 | 20 | 21 | 22 | 24 | 25 | 27 | 29 | 30 | 32 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /admin/static/media/Stairway.9b007e08605296110003.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /admin/static/media/Stairwell.0914feea948153a8637a.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 11 | 12 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /admin/static/media/Storeroom.7de4e6f3364554459b8a.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /admin/static/media/Summer House.541a9fec69f01105e244.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /admin/static/media/Swimming Pool.190b378cb0707edb9461.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 9 | 11 | 13 | 15 | 17 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /admin/static/media/Table Lamps.bd92de33bf86b6cbaec9.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /admin/static/media/Temperature Sensors.75d805988a6b77b231d8.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 9 | 13 | 15 | 17 | 19 | 21 | 23 | 25 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /admin/static/media/Terrace.d71d07d9290674f2ca20.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /admin/static/media/Toilet.83604dd2daafb67067dd.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /admin/static/media/Tv.4e9745a548e57bfac0c7.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /admin/static/media/Upstairs.441813e54e0daca0882d.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /admin/static/media/Ventilation.c31761d86d67e245ac92.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /admin/static/media/Washroom.bfb54196f381f36de9d6.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /admin/static/media/Water Consumption.68891649591cc2434c5b.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /admin/static/media/Water Heater.7e4bb4d99a5213f24d08.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /admin/static/media/Wc.83604dd2daafb67067dd.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /admin/static/media/Weather.e91dae647698d48365e3.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /admin/static/media/Window.421664f57c35e5109aa2.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /admin/static/media/Workshop.7856e59fe4f164c90609.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /admin/style.css: -------------------------------------------------------------------------------- 1 | .selectedScene { 2 | background-color: grey; 3 | } 4 | 5 | .App .splitter-layout .layout-splitter { 6 | background: #595858; 7 | } 8 | -------------------------------------------------------------------------------- /admin/tab_m.html: -------------------------------------------------------------------------------- 1 | Text2Command [ioBroker]
-------------------------------------------------------------------------------- /admin/text2command.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ioBroker/ioBroker.text2command/36a43b866098d2ea913a47feb531efb8f9ef7e1d/admin/text2command.png -------------------------------------------------------------------------------- /img/enums.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ioBroker/ioBroker.text2command/36a43b866098d2ea913a47feb531efb8f9ef7e1d/img/enums.png -------------------------------------------------------------------------------- /lib/functions.js: -------------------------------------------------------------------------------- 1 | /* jshint -W097 */ 2 | /* jshint strict: false */ 3 | /* jslint node: true */ 4 | 'use strict'; 5 | 6 | // TODO: translate it to "it, es, pl, pt, nl, fr, zh-cn" 7 | 8 | // Translation of functions, used for detection 9 | const functions = { 10 | "backlight/beleuchtung/подсветка": {"ru" : "подсветк/светильник","de": "beleuchtung/rücklicht", "en": "back light/back light/rear light" }, 11 | "light/licht/свет": {"ru" : "свет/лампу/лампа", "de": "licht/lampe", "en": "light/lamp" }, 12 | "heating/heizung/отопление": {"ru" : "отопление/батаре", "de": "heizung", "en": "heating" }, 13 | "blind/rollladen/rolladen/жалюзи/окна": {"ru" : "жалюзи/ставни", "de": "rollladen", "en": "shutter" }, 14 | "music/musik/музыка": {"ru" : "музык", "de": "musik", "en": "music" }, 15 | "security/sicherheit/alarm/alarmanlage/сигнализация/охрана": {"ru" : "сигнал/охран", "de": "sicherheit/alarm", "en": "security/alarm" }, 16 | "lock/door/schloß/tür/замок/дверь": {"ru" : "замок/дверь/ворота", "de": "verschluß/schloß/tür","en": "lock/door" } 17 | }; 18 | 19 | // Used for answer 20 | const functionsGenitive = { 21 | "backlight/beleuchtung/подсветка": {"ru" : "подсветки", "de": "e Beleuchtung", "en": "back light" }, 22 | "light/licht/свет": {"ru" : "ламп", "de": "e Lampen", "en": "light" }, 23 | "heating/heizung/отопление": {"ru" : "отопление", "de": "e Heizung", "en": "heating" }, 24 | "blind/rollladen/rolladen/жалюзи/окна": {"ru" : "жалюзей", "de": "e Rollladen", "en": "shutter" }, 25 | "music/musik/музыка": {"ru" : "музыки", "de": "e Musik", "en": "music" }, 26 | "security/sicherheit/alarm/alarmanlage/сигнализация/охрана": {"ru" : "сигнализации", "de": "e Sicherheitssystem", "en": "security" }, 27 | "lock/door/schloß/tür/замок/дверь": {"ru" : "замков", "de": "e Verschluße", "en": "lock" } 28 | }; 29 | 30 | // Used for answer 31 | const functionsAccusative = { 32 | "backlight/beleuchtung/подсветка": {"ru" : "подсветку", "de": "die Beleuchtung","en": "back light" }, 33 | "light/licht/свет": {"ru" : "свет", "de": "das Licht", "en": "light" }, 34 | "heating/heizung/отопление": {"ru" : "отопление", "de": "die Heizung", "en": "heating" }, 35 | "blind/rollladen/rolladen/жалюзи/окна": {"ru" : "жалюзи", "de": "die Rollladen", "en": "shutter" }, 36 | "music/musik/музыка": {"ru" : "музыку", "de": "die Musik", "en": "music" }, 37 | "security/sicherheit/alarm/alarmanlage/сигнализация/охрана": {"ru" : "сигнализацию", "de": "das Sicherheitssystem", "en": "security" }, 38 | "lock/door/schloß/tür/замок/дверь": {"ru" : "замок", "de": "den Verschluß", "en": "lock" } 39 | }; 40 | 41 | module.exports = { 42 | functionsAccusative, 43 | functionsGenitive, 44 | functions 45 | }; 46 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "iobroker.text2command", 3 | "version": "3.0.3", 4 | "description": "Convert texts to ioBroker commands.", 5 | "author": { 6 | "name": "bluefox", 7 | "email": "dogafox@gmail.com" 8 | }, 9 | "homepage": "https://github.com/ioBroker/ioBroker.text2command", 10 | "keywords": [ 11 | "ioBroker", 12 | "text2command" 13 | ], 14 | "engines": { 15 | "node": ">=16" 16 | }, 17 | "repository": { 18 | "type": "git", 19 | "url": "https://github.com/ioBroker/ioBroker.text2command" 20 | }, 21 | "dependencies": { 22 | "@iobroker/adapter-core": "^3.0.6" 23 | }, 24 | "devDependencies": { 25 | "@alcalzone/release-script": "^3.8.0", 26 | "@alcalzone/release-script-plugin-iobroker": "^3.7.2", 27 | "@alcalzone/release-script-plugin-license": "^3.7.0", 28 | "gulp": "^4.0.2", 29 | "mocha": "^10.8.2", 30 | "chai": "^4.3.10", 31 | "gulp-rename": "^2.0.0" 32 | }, 33 | "bugs": { 34 | "url": "https://github.com/ioBroker/ioBroker.text2command/issues" 35 | }, 36 | "main": "main.js", 37 | "files": [ 38 | "admin/", 39 | "img/", 40 | "lib/", 41 | "io-package.json", 42 | "LICENSE", 43 | "main.js" 44 | ], 45 | "scripts": { 46 | "test": "node node_modules/mocha/bin/mocha --exit", 47 | "prepublishOnly": "node node_modules/gulp/bin/gulp.js", 48 | "build": "node node_modules/gulp/bin/gulp.js", 49 | "release": "release-script", 50 | "release-patch": "release-script patch --yes", 51 | "release-minor": "release-script minor --yes", 52 | "release-major": "release-script major --yes", 53 | "update-packages": "ncu --upgrade && cd src && ncu --upgrade", 54 | "npm": "npm i && cd src && npm i -f", 55 | "beforePush": "node node_modules/gulp/bin/gulp.js" 56 | }, 57 | "license": "MIT", 58 | "readmeFilename": "README.md" 59 | } 60 | -------------------------------------------------------------------------------- /src/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | env: { 3 | browser: true, 4 | es2021: true, 5 | }, 6 | extends: [ 7 | 'eslint:recommended', 8 | 'plugin:react/recommended', 9 | 'airbnb', 10 | // 'react-app', 11 | 'plugin:eqeqeq-fix/recommended', 12 | ], 13 | parserOptions: { 14 | ecmaFeatures: { 15 | jsx: true, 16 | }, 17 | ecmaVersion: 'latest', 18 | sourceType: 'module', 19 | }, 20 | plugins: [ 21 | 'only-warn', 22 | 'react', 23 | ], 24 | rules: { 25 | 'arrow-parens': [1, 'as-needed'], 26 | 'react/jsx-indent': 'off', 27 | 'react/jsx-indent-props': 'off', 28 | 'react/no-access-state-in-setstate': 'off', 29 | 'jsx-a11y/click-events-have-key-events': 'off', 30 | 'jsx-a11y/no-static-element-interactions': 'off', 31 | 'no-plusplus': 'off', 32 | 'react/react-in-jsx-scope': 'off', 33 | 'react/prop-types': 'off', 34 | 'react/no-render-return-value': 'off', 35 | 'max-len': 'off', 36 | 'react/destructuring-assignment': 'off', 37 | 'react/prefer-stateless-function': 'off', 38 | 'react/self-closing-comp': 'off', 39 | 'react/jsx-filename-extension': 'off', 40 | 'no-nested-ternary': 'off', 41 | 'react/no-array-index-key': 'off', 42 | 'react/jsx-props-no-spreading': 'off', 43 | 'react/sort-comp': 'off', 44 | 'react/no-did-update-set-state': 'off', 45 | 'global-require': 'off', 46 | 'import/extensions': 'off', 47 | 'operator-linebreak': 'off', 48 | 'no-unused-expressions': 'off', 49 | 'prefer-destructuring': 'off', 50 | 'no-return-assign': 'off', 51 | 'no-multi-spaces': 'off', 52 | 'key-spacing': 'off', 53 | 'no-undef': 2, 54 | 'react/forbid-prop-types': 'off', 55 | 'react/require-default-props': 'off', 56 | 'import/no-extraneous-dependencies': 'off', 57 | 'react/jsx-wrap-multilines': 'off', 58 | 'react/jsx-closing-tag-location': 'off', 59 | 'no-restricted-syntax': 'off', 60 | 'guard-for-in': 'off', 61 | // 'linebreak-style': ["error", "windows"], 62 | 'linebreak-style': ['off'], 63 | 'no-param-reassign': 'off', 64 | 'no-await-in-loop': 'off', 65 | 'no-console': ['error', { allow: ['warn', 'error', 'log'] }], 66 | 'no-underscore-dangle': 'off', 67 | 'no-constant-condition': 'off', 68 | 'no-loop-func': 'off', 69 | 'no-continue': 'off', 70 | 'implicit-arrow-linebreak': 'off', 71 | radix: 'off', 72 | indent: ['error', 4, { SwitchCase: 1 }], 73 | 'no-alert': 'off', 74 | 'react/function-component-definition': 'off', 75 | }, 76 | }; 77 | -------------------------------------------------------------------------------- /src/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # production 12 | /build 13 | 14 | # misc 15 | .DS_Store 16 | .env.local 17 | .env.development.local 18 | .env.test.local 19 | .env.production.local 20 | 21 | npm-debug.log* 22 | yarn-debug.log* 23 | yarn-error.log* 24 | -------------------------------------------------------------------------------- /src/README.md: -------------------------------------------------------------------------------- 1 | This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). 2 | 3 | ## Available Scripts 4 | 5 | In the project directory, you can run: 6 | 7 | ### `npm start` 8 | 9 | Runs the app in the development mode.
10 | Open [http://localhost:3000](http://localhost:3000) to view it in the browser. 11 | 12 | The page will reload if you make edits.
13 | You will also see any lint errors in the console. 14 | 15 | ### `npm test` 16 | 17 | Launches the test runner in the interactive watch mode.
18 | See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information. 19 | 20 | ### `npm run build` 21 | 22 | Builds the app for production to the `build` folder.
23 | It correctly bundles React in production mode and optimizes the build for the best performance. 24 | 25 | The build is minified and the filenames include the hashes.
26 | Your app is ready to be deployed! 27 | 28 | See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information. 29 | 30 | ### `npm run eject` 31 | 32 | **Note: this is a one-way operation. Once you `eject`, you can’t go back!** 33 | 34 | If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project. 35 | 36 | Instead, it will copy all the configuration files and the transitive dependencies (Webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own. 37 | 38 | You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it. 39 | 40 | ## Learn More 41 | 42 | You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started). 43 | 44 | To learn React, check out the [React documentation](https://reactjs.org/). 45 | 46 | ### Code Splitting 47 | 48 | This section has moved here: https://facebook.github.io/create-react-app/docs/code-splitting 49 | 50 | ### Analyzing the Bundle Size 51 | 52 | This section has moved here: https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size 53 | 54 | ### Making a Progressive Web App 55 | 56 | This section has moved here: https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app 57 | 58 | ### Advanced Configuration 59 | 60 | This section has moved here: https://facebook.github.io/create-react-app/docs/advanced-configuration 61 | 62 | ### Deployment 63 | 64 | This section has moved here: https://facebook.github.io/create-react-app/docs/deployment 65 | 66 | ### `npm run build` fails to minify 67 | 68 | This section has moved here: https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify 69 | -------------------------------------------------------------------------------- /src/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "text2command-react", 3 | "version": "3.0.3", 4 | "private": true, 5 | "dependencies": { 6 | "@iobroker/adapter-react-v5": "^4.8.1", 7 | "@mui/icons-material": "^5.15.21", 8 | "@mui/material": "5.14.14", 9 | "@mui/styles": "5.14.14", 10 | "@sentry/browser": "^7.88.0", 11 | "@sentry/integrations": "^7.88.0", 12 | "babel-eslint": "^10.1.0", 13 | "react": "^18.2.0", 14 | "react-beautiful-dnd": "^13.1.1", 15 | "react-dom": "^18.2.0", 16 | "react-scripts": "^5.0.1", 17 | "react-splitter-layout": "^4.0.0", 18 | "uuid": "^9.0.1", 19 | "eslint": "^8.56.0", 20 | "eslint-config-airbnb": "^19.0.4", 21 | "eslint-plugin-eqeqeq-fix": "^1.0.3", 22 | "eslint-plugin-import": "^2.29.1", 23 | "eslint-plugin-jsx-a11y": "^6.8.0", 24 | "eslint-plugin-only-warn": "^1.1.0", 25 | "eslint-plugin-react": "^7.33.2" 26 | }, 27 | "scripts": { 28 | "start": "react-scripts start", 29 | "build": "react-scripts build", 30 | "test": "react-scripts test", 31 | "eject": "react-scripts eject", 32 | "lint": "eslint --fix --ext .js,.jsx src" 33 | }, 34 | "eslintConfig": { 35 | "extends": "react-app" 36 | }, 37 | "homepage": ".", 38 | "browserslist": [ 39 | ">0.2%", 40 | "not dead", 41 | "not ie <= 11", 42 | "not op_mini all" 43 | ] 44 | } -------------------------------------------------------------------------------- /src/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ioBroker/ioBroker.text2command/36a43b866098d2ea913a47feb531efb8f9ef7e1d/src/public/favicon.ico -------------------------------------------------------------------------------- /src/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 11 | 12 | 16 | 17 | 18 | 34 | 43 | Text2Command [ioBroker] 44 | 45 | 46 | 47 |
48 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /src/public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "Consumption", 3 | "name": "ioBroker Consumption Configuration", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | } 10 | ], 11 | "start_url": ".", 12 | "display": "standalone", 13 | "theme_color": "#000000", 14 | "background_color": "#ffffff" 15 | } 16 | -------------------------------------------------------------------------------- /src/public/style.css: -------------------------------------------------------------------------------- 1 | .selectedScene { 2 | background-color: grey; 3 | } 4 | 5 | .App .splitter-layout .layout-splitter { 6 | background: #595858; 7 | } 8 | -------------------------------------------------------------------------------- /src/public/text2command.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ioBroker/ioBroker.text2command/36a43b866098d2ea913a47feb531efb8f9ef7e1d/src/public/text2command.png -------------------------------------------------------------------------------- /src/src/assets/text2command.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ioBroker/ioBroker.text2command/36a43b866098d2ea913a47feb531efb8f9ef7e1d/src/src/assets/text2command.png -------------------------------------------------------------------------------- /src/src/i18n/de.json: -------------------------------------------------------------------------------- 1 | { 2 | "Select rule": "Regel auswählen", 3 | "System": "System", 4 | "Language": "Sprache", 5 | "Answer in id": "Antwort in ID", 6 | "Processor's id": "Prozessor-ID", 7 | "Timeout for processor": "Timeout für den Prozessor", 8 | "Settings": "Einstellungen", 9 | "Cancel": "Abbrechen", 10 | "Test phrase": "Test-Satz", 11 | "Argument": "Argument", 12 | "Confirmation text": "Bestätigungstext", 13 | "Keywords": "Schlüsselwörter", 14 | "Interrupt processing": "Verarbeitung unterbrechen", 15 | "You can use %s, that will be replaced with current value of state. %u will be replaced by unit": "%s wird durch den aktuellen Statuswert ersetzt. %u wird durch die Einheit ersetzt", 16 | "Ok": "Ok", 17 | "Create Rule": "Regel erstellen", 18 | "Are you sure?": "Wirklich sicher?", 19 | "You want to delete: %s": "Soll \"%s\" wirklich gelöscht werden?", 20 | "refresh": "Aktualisieren", 21 | "lang_en": "Englisch", 22 | "lang_de": "Deutsch", 23 | "lang_ru": "Russisch", 24 | "ms": "ms", 25 | "Remove rule": "Regel entfernen", 26 | "Refresh": "Aktualisieren", 27 | "Search rule": "Filtern", 28 | "Create rule": "Regel erstellen", 29 | "Save": "Speichern", 30 | "Do not interrupt processing": "Weitere Regeln anwenden", 31 | "Instance is not running": "Instanz läuft nicht", 32 | "Create a new rule with a \"+\" on the left": "Eine neue Regel kann mit dem \"+\" auf der linken Seite erstellt werden", 33 | "Edit name or type of rule": "Namen oder den Regeltyp bearbeiten", 34 | "New rule": "Neue Regel", 35 | "Edit rule": "Regel bearbeiten", 36 | "Rule": "Regel", 37 | "Name": "Name", 38 | "Write to response by every command": "Bei jedem Befehl den Antwort-Zustand schreiben", 39 | "Clone rule": "Regel klonen", 40 | "Name already exist": "Name existiert bereits", 41 | "Create new rule": "Neue Regel erstellen", 42 | "Copy rule": "Regel kopieren", 43 | "Please confirm or cancel changes before leaving": "Bitte vor dem Verlassen die Änderungen bestätigen oder verwerfen", 44 | "You have changed rule": "Die Regel wurde geändert", 45 | "Save and go": "Speichern und loslegen", 46 | "Don't save and go": "Nicht speichern und verlassen", 47 | "Do not answer \"I don't understand\" if no rules found": "Nicht mit „Ich verstehe nicht“ antworten, wenn keine Regeln gefunden wurden", 48 | "Convert 0/1 to false/true": "0/1 in falsch/wahr kovertieren", 49 | "unsaved": "ungespeichert", 50 | "Apply": "Anwenden", 51 | "Apply and save": "Anwenden und speichern", 52 | "Create": "Erstellen", 53 | "Copy": "Kopieren" 54 | } 55 | -------------------------------------------------------------------------------- /src/src/i18n/en.json: -------------------------------------------------------------------------------- 1 | { 2 | "Select rule": "Select rule", 3 | "System": "System", 4 | "Language": "Language", 5 | "Answer in id": "Answer in ID", 6 | "Processor's id": "Processor's ID", 7 | "Timeout for processor": "Timeout for processor", 8 | "Settings": "Settings", 9 | "Cancel": "Cancel", 10 | "Test phrase": "Test phrase", 11 | "Argument": "Argument", 12 | "Confirmation text": "Confirmation text", 13 | "Keywords": "Keywords", 14 | "Interrupt processing": "Interrupt processing", 15 | "You can use %s, that will be replaced with current value of state. %u will be replaced by unit": "You can use %s, that will be replaced with current value of state. %u will be replaced by unit", 16 | "Ok": "Ok", 17 | "Create Rule": "Create Rule", 18 | "Are you sure?": "Are you sure?", 19 | "You want to delete: %s": "You want to delete: \"%s\"", 20 | "Refresh": "Refresh", 21 | "Remove rule": "Remove rule", 22 | "Search rule": "Search rule", 23 | "lang_en": "english", 24 | "lang_de": "German", 25 | "lang_ru": "russian", 26 | "ms": "ms", 27 | "Create rule": "Create rule", 28 | "refresh": "Refresh", 29 | "Save": "Save", 30 | "Do not interrupt processing": "Do not interrupt processing", 31 | "Instance is not running": "Instance is not running", 32 | "Create a new rule with a \"+\" on the left": "Create a new rule with a \"+\" on the left", 33 | "Edit name or type of rule": "Edit name or type of rule", 34 | "New rule": "New rule", 35 | "Edit rule": "Edit rule", 36 | "Rule": "Rule", 37 | "Name": "Name", 38 | "Write to response by every command": "Write to response by every command", 39 | "Clone rule": "Clone the rule", 40 | "Name already exist": "Name already exist", 41 | "Create new rule": "Create new rule", 42 | "Copy rule": "Copy rule", 43 | "Please confirm or cancel changes before leaving": "Please confirm or cancel changes before leaving", 44 | "You have changed rule": "You have changed rule", 45 | "Save and go": "Save and go", 46 | "Don't save and go": "Don't save and leave", 47 | "Do not answer \"I don't understand\" if no rules found": "Do not answer \"I don't understand\" if no rules found", 48 | "Convert 0/1 to false/true": "Convert 0/1 to false/true", 49 | "unsaved": "unsaved", 50 | "Apply": "Apply", 51 | "Apply and save": "Apply and save", 52 | "Create": "Create", 53 | "Copy": "Copy" 54 | } 55 | -------------------------------------------------------------------------------- /src/src/i18n/es.json: -------------------------------------------------------------------------------- 1 | { 2 | "Select rule": "Seleccionar regla", 3 | "System": "Sistema", 4 | "Language": "Idioma", 5 | "Answer in id": "Respuesta en ID", 6 | "Processor's id": "ID del procesador", 7 | "Timeout for processor": "Tiempo de espera para el procesador", 8 | "Settings": "Configuraciones", 9 | "Cancel": "Cancelar", 10 | "Test phrase": "Frase de prueba", 11 | "Argument": "Argumento", 12 | "Confirmation text": "Texto de confirmación", 13 | "Keywords": "Palabras clave", 14 | "Interrupt processing": "Procesamiento de interrupción", 15 | "You can use %s, that will be replaced with current value of state. %u will be replaced by unit": "Puede usar %s, que se reemplazará con el valor actual del estado. %u será reemplazado por unidad", 16 | "Ok": "Okay", 17 | "Create Rule": "Crear regla", 18 | "Are you sure?": "¿Estás seguro?", 19 | "You want to delete: %s": "Desea eliminar: \"%s\"", 20 | "refresh": "Actualizar", 21 | "lang_en": "Inglés", 22 | "lang_de": "alemán", 23 | "lang_ru": "ruso", 24 | "ms": "ms", 25 | "Remove rule": "Eliminar regla", 26 | "Refresh": "Actualizar", 27 | "Search rule": "Busca la regla", 28 | "Create rule": "Crear regla", 29 | "Save": "Salvar", 30 | "Do not interrupt processing": "No interrumpa el procesamiento.", 31 | "Instance is not running": "La instancia no se está ejecutando", 32 | "Create a new rule with a \"+\" on the left": "Cree una nueva regla con un \"+\" a la izquierda", 33 | "Edit name or type of rule": "Editar nombre o tipo de regla", 34 | "New rule": "Nueva regla", 35 | "Edit rule": "Editar regla", 36 | "Rule": "Regla", 37 | "Name": "Nombre", 38 | "Write to response by every command": "Escribe a la respuesta por cada comando", 39 | "Clone rule": "Clonar la regla", 40 | "Name already exist": "El nombre ya existe", 41 | "Create new rule": "Crear nueva regla", 42 | "Copy rule": "Copiar regla", 43 | "Please confirm or cancel changes before leaving": "Confirme o cancele los cambios antes de salir", 44 | "You have changed rule": "Has cambiado de regla", 45 | "Save and go": "Guardar y listo", 46 | "Don't save and go": "No guardes y te vayas", 47 | "Do not answer \"I don't understand\" if no rules found": "No responda \"No entiendo\" si no se encuentran reglas", 48 | "Convert 0/1 to false/true": "Convertir 0/1 a falso/verdadero", 49 | "unsaved": "no guardado", 50 | "Apply": "Aplicar", 51 | "Apply and save": "Aplicar y guardar", 52 | "Create": "Crear", 53 | "Copy": "Copiar" 54 | } -------------------------------------------------------------------------------- /src/src/i18n/fr.json: -------------------------------------------------------------------------------- 1 | { 2 | "Select rule": "Sélectionnez la règle", 3 | "System": "Système", 4 | "Language": "Langue", 5 | "Answer in id": "Réponse dans l'ID", 6 | "Processor's id": "ID du processeur", 7 | "Timeout for processor": "Délai d'expiration pour le processeur", 8 | "Settings": "Paramètres", 9 | "Cancel": "Annuler", 10 | "Test phrase": "Expression de test", 11 | "Argument": "Argument", 12 | "Confirmation text": "Texte de confirmation", 13 | "Keywords": "Mots clés", 14 | "Interrupt processing": "Interrompre le traitement", 15 | "You can use %s, that will be replaced with current value of state. %u will be replaced by unit": "Vous pouvez utiliser %s, qui sera remplacé par la valeur actuelle de l'état. %u sera remplacé par l'unité", 16 | "Ok": "Ok", 17 | "Create Rule": "Créer une règle", 18 | "Are you sure?": "Êtes-vous sûr?", 19 | "You want to delete: %s": "Vous souhaitez supprimer: \"%s\"", 20 | "refresh": "Rafraîchir", 21 | "lang_en": "Anglais", 22 | "lang_de": "allemand", 23 | "lang_ru": "russe", 24 | "ms": "ms", 25 | "Remove rule": "Supprimer la règle", 26 | "Refresh": "Rafraîchir", 27 | "Search rule": "Rechercher la règle", 28 | "Create rule": "Créer une règle", 29 | "Save": "sauver", 30 | "Do not interrupt processing": "N'interrompez pas le traitement", 31 | "Instance is not running": "L'instance n'est pas en cours d'exécution", 32 | "Create a new rule with a \"+\" on the left": "Créez une nouvelle règle avec un \"+\" à gauche", 33 | "Edit name or type of rule": "Modifier le nom ou le type de règle", 34 | "New rule": "Nouvelle règle", 35 | "Edit rule": "Modifier la règle", 36 | "Rule": "Règle", 37 | "Name": "Nom", 38 | "Write to response by every command": "Ecrire à la réponse de chaque commande", 39 | "Clone rule": "Cloner la règle", 40 | "Name already exist": "Le nom existe déjà", 41 | "Create new rule": "Créer une nouvelle règle", 42 | "Copy rule": "Copier la règle", 43 | "Please confirm or cancel changes before leaving": "Veuillez confirmer ou annuler les modifications avant de partir", 44 | "You have changed rule": "Vous avez changé de règle", 45 | "Save and go": "Économisez et partez", 46 | "Don't save and go": "Ne sauvez pas et ne partez pas", 47 | "Do not answer \"I don't understand\" if no rules found": "Ne répondez pas \"je ne comprends pas\" si aucune règle n'a été trouvée", 48 | "Convert 0/1 to false/true": "Convertir 0/1 en faux/vrai", 49 | "unsaved": "non enregistré", 50 | "Apply": "Appliquer", 51 | "Apply and save": "Appliquer et enregistrer", 52 | "Create": "Créer", 53 | "Copy": "Copie" 54 | } -------------------------------------------------------------------------------- /src/src/i18n/it.json: -------------------------------------------------------------------------------- 1 | { 2 | "Select rule": "Seleziona la regola", 3 | "System": "Sistema", 4 | "Language": "linguaggio", 5 | "Answer in id": "Risposta in ID", 6 | "Processor's id": "ID del processore", 7 | "Timeout for processor": "Timeout per processore", 8 | "Settings": "impostazioni", 9 | "Cancel": "Annulla", 10 | "Test phrase": "Frase di prova", 11 | "Argument": "Discussione", 12 | "Confirmation text": "Testo di conferma", 13 | "Keywords": "parole", 14 | "Interrupt processing": "Interrompere l'elaborazione", 15 | "You can use %s, that will be replaced with current value of state. %u will be replaced by unit": "Puoi usare %s, che verrà sostituito con il valore corrente di stato. %u verrà sostituito dall'unità", 16 | "Ok": "Ok", 17 | "Create Rule": "Crea regola", 18 | "Are you sure?": "Sei sicuro?", 19 | "You want to delete: %s": "Vuoi eliminare: \"%s\"", 20 | "refresh": "ricaricare", 21 | "lang_en": "Inglese", 22 | "lang_de": "Tedesco", 23 | "lang_ru": "russo", 24 | "ms": "ms", 25 | "Remove rule": "Rimuovi regola", 26 | "Refresh": "ricaricare", 27 | "Search rule": "Cerca la regola", 28 | "Create rule": "Crea regola", 29 | "Save": "Salva", 30 | "Do not interrupt processing": "Non interrompere l'elaborazione", 31 | "Instance is not running": "L'istanza non è in esecuzione", 32 | "Create a new rule with a \"+\" on the left": "Crea una nuova regola con un \"+\" a sinistra", 33 | "Edit name or type of rule": "Modifica il nome o il tipo di regola", 34 | "New rule": "Nuova regola", 35 | "Edit rule": "Modifica regola", 36 | "Rule": "Regola", 37 | "Name": "Nome", 38 | "Write to response by every command": "Scrivi alla risposta con ogni comando", 39 | "Clone rule": "Clona la regola", 40 | "Name already exist": "Il nome esiste già", 41 | "Create new rule": "Crea nuova regola", 42 | "Copy rule": "Copia regola", 43 | "Please confirm or cancel changes before leaving": "Si prega di confermare o annullare le modifiche prima di partire", 44 | "You have changed rule": "Hai cambiato regola", 45 | "Save and go": "Salva e vai", 46 | "Don't save and go": "Non salvare e vattene", 47 | "Do not answer \"I don't understand\" if no rules found": "Non rispondere \"Non capisco\" se non trovi regole", 48 | "Convert 0/1 to false/true": "Converti 0/1 in falso/vero", 49 | "unsaved": "non salvato", 50 | "Apply": "Fare domanda a", 51 | "Apply and save": "Applica e salva", 52 | "Create": "Creare", 53 | "Copy": "copia" 54 | } -------------------------------------------------------------------------------- /src/src/i18n/nl.json: -------------------------------------------------------------------------------- 1 | { 2 | "Select rule": "Selecteer regel", 3 | "System": "Systeem", 4 | "Language": "Taal", 5 | "Answer in id": "Antwoord in ID", 6 | "Processor's id": "Verwerker ID", 7 | "Timeout for processor": "Time-out voor processor", 8 | "Settings": "Instellingen", 9 | "Cancel": "Annuleer", 10 | "Test phrase": "Testzin", 11 | "Argument": "Argument", 12 | "Confirmation text": "Bevestigingstekst", 13 | "Keywords": "Sleutelwoorden", 14 | "Interrupt processing": "Verwerking onderbreken", 15 | "You can use %s, that will be replaced with current value of state. %u will be replaced by unit": "U kunt %s gebruiken, dat zal worden vervangen door de huidige waarde van de staat. %u wordt vervangen door eenheid", 16 | "Ok": "OK", 17 | "Create Rule": "Creëer regel", 18 | "Are you sure?": "Weet je het zeker?", 19 | "You want to delete: %s": "Je wilt verwijderen: %s", 20 | "refresh": "Vernieuwen", 21 | "lang_en": "Engels", 22 | "lang_de": "Duitse", 23 | "lang_ru": "Russisch", 24 | "ms": "ms", 25 | "Remove rule": "Regel verwijderen", 26 | "Refresh": "Vernieuwen", 27 | "Search rule": "Zoek de regel", 28 | "Create rule": "Creëer regel", 29 | "Save": "Sparen", 30 | "Do not interrupt processing": "Onderbreek de verwerking niet", 31 | "Instance is not running": "Instantie is niet actief", 32 | "Create a new rule with a \"+\" on the left": "Maak een nieuwe regel met een \"+\" aan de linkerkant", 33 | "Edit name or type of rule": "Bewerk naam of type regel", 34 | "New rule": "Nieuwe regel", 35 | "Edit rule": "Regel bewerken", 36 | "Rule": "Regel", 37 | "Name": "Naam", 38 | "Write to response by every command": "Schrijf bij elke opdracht op het antwoord", 39 | "Clone rule": "Kloon de regel", 40 | "Name already exist": "Naam bestaat al", 41 | "Create new rule": "Maak een nieuwe regel", 42 | "Copy rule": "Kopieer regel", 43 | "Please confirm or cancel changes before leaving": "Bevestig of annuleer wijzigingen voordat u vertrekt", 44 | "You have changed rule": "Je hebt de regel veranderd", 45 | "Save and go": "Bewaar en ga", 46 | "Don't save and go": "Sla niet op en vertrek", 47 | "Do not answer \"I don't understand\" if no rules found": "Antwoord niet \"Ik begrijp het niet\" als er geen regels zijn gevonden", 48 | "Convert 0/1 to false/true": "Converteer 0/1 naar false/true", 49 | "unsaved": "niet opgeslagen", 50 | "Apply": "Toepassen", 51 | "Apply and save": "Toepassen en opslaan", 52 | "Create": "Creëren", 53 | "Copy": "Kopiëren" 54 | } -------------------------------------------------------------------------------- /src/src/i18n/pl.json: -------------------------------------------------------------------------------- 1 | { 2 | "Select rule": "Wybierz regułę", 3 | "System": "System", 4 | "Language": "Język", 5 | "Answer in id": "Odpowiedz w ID", 6 | "Processor's id": "ID procesora", 7 | "Timeout for processor": "Limit czasu dla procesora", 8 | "Settings": "Ustawienia", 9 | "Cancel": "Odwołaj", 10 | "Test phrase": "Testowa fraza", 11 | "Argument": "Argument", 12 | "Confirmation text": "Tekst potwierdzający", 13 | "Keywords": "Słowa kluczowe", 14 | "Interrupt processing": "Przerwać przetwarzanie", 15 | "You can use %s, that will be replaced with current value of state. %u will be replaced by unit": "Możesz użyć %s, który zostanie zastąpiony bieżącą wartością stanu. %u zostanie zastąpione przez jednostkę", 16 | "Ok": "Ok", 17 | "Create Rule": "Stwórz zasadę", 18 | "Are you sure?": "Jesteś pewny?", 19 | "You want to delete: %s": "Chcesz usunąć: \"%s\"", 20 | "refresh": "Odświeżać", 21 | "lang_en": "język angielski", 22 | "lang_de": "Niemiecki", 23 | "lang_ru": "Rosyjski", 24 | "ms": "ms", 25 | "Remove rule": "Usuń regułę", 26 | "Refresh": "Odświeżać", 27 | "Search rule": "Wyszukaj regułę", 28 | "Create rule": "Stwórz zasadę", 29 | "Save": "Zapisać", 30 | "Do not interrupt processing": "Nie przerywaj przetwarzania", 31 | "Instance is not running": "Instancja nie działa", 32 | "Create a new rule with a \"+\" on the left": "Utwórz nową regułę z „+” po lewej stronie", 33 | "Edit name or type of rule": "Edytuj nazwę lub typ reguły", 34 | "New rule": "Nowa zasada", 35 | "Edit rule": "Edytuj regułę", 36 | "Rule": "Reguła", 37 | "Name": "Nazwa", 38 | "Write to response by every command": "Napisz odpowiedź na każde polecenie", 39 | "Clone rule": "Sklonuj regułę", 40 | "Name already exist": "Nazwa już istnieje", 41 | "Create new rule": "Utwórz nową regułę", 42 | "Copy rule": "Skopiuj regułę", 43 | "Please confirm or cancel changes before leaving": "Potwierdź lub anuluj zmiany przed opuszczeniem", 44 | "You have changed rule": "Zmieniłeś regułę", 45 | "Save and go": "Zapisz i idź", 46 | "Don't save and go": "Nie zapisuj i nie wychodź", 47 | "Do not answer \"I don't understand\" if no rules found": "Nie odpowiadaj „Nie rozumiem”, jeśli nie znaleziono żadnych reguł", 48 | "Convert 0/1 to false/true": "Konwertuj 0/1 na fałsz/prawdę", 49 | "unsaved": "niezapisany", 50 | "Apply": "Stosować", 51 | "Apply and save": "Zastosuj i zapisz", 52 | "Create": "Tworzyć", 53 | "Copy": "Kopiuj" 54 | } 55 | -------------------------------------------------------------------------------- /src/src/i18n/pt.json: -------------------------------------------------------------------------------- 1 | { 2 | "Select rule": "Selecionar regra", 3 | "System": "Sistema", 4 | "Language": "Língua", 5 | "Answer in id": "Resposta em ID", 6 | "Processor's id": "ID do processador", 7 | "Timeout for processor": "Tempo limite do processador", 8 | "Settings": "Configurações", 9 | "Cancel": "Cancelar", 10 | "Test phrase": "Frase de teste", 11 | "Argument": "Argumento", 12 | "Confirmation text": "Texto de confirmação", 13 | "Keywords": "Palavras-chave", 14 | "Interrupt processing": "Interromper o processamento", 15 | "You can use %s, that will be replaced with current value of state. %u will be replaced by unit": "Você pode usar %s, que será substituído pelo valor atual do estado. %u será substituído por unidade", 16 | "Ok": "Ok", 17 | "Create Rule": "Criar regra", 18 | "Are you sure?": "Você tem certeza?", 19 | "You want to delete: %s": "Você deseja excluir: \"%s\"", 20 | "refresh": "Atualizar", 21 | "lang_en": "Inglês", 22 | "lang_de": "alemão", 23 | "lang_ru": "russo", 24 | "ms": "ms", 25 | "Remove rule": "Remover regra", 26 | "Refresh": "Atualizar", 27 | "Search rule": "Pesquise a regra", 28 | "Create rule": "Criar regra", 29 | "Save": "Salve", 30 | "Do not interrupt processing": "Não interrompa o processamento", 31 | "Instance is not running": "Instância não está sendo executada", 32 | "Create a new rule with a \"+\" on the left": "Crie uma nova regra com um \"+\" à esquerda", 33 | "Edit name or type of rule": "Editar nome ou tipo de regra", 34 | "New rule": "Nova regra", 35 | "Edit rule": "Editar regra", 36 | "Rule": "Regra", 37 | "Name": "Nome", 38 | "Write to response by every command": "Escreva na resposta por todos os comandos", 39 | "Clone rule": "Clone a regra", 40 | "Name already exist": "Nome já existe", 41 | "Create new rule": "Criar nova regra", 42 | "Copy rule": "Copiar regra", 43 | "Please confirm or cancel changes before leaving": "Confirme ou cancele as alterações antes de sair", 44 | "You have changed rule": "Você mudou a regra", 45 | "Save and go": "Salve e vá", 46 | "Don't save and go": "Não salve e saia", 47 | "Do not answer \"I don't understand\" if no rules found": "Não responda \"não entendo\" se nenhuma regra for encontrada", 48 | "Convert 0/1 to false/true": "Converter 0/1 em falso/verdadeiro", 49 | "unsaved": "não salvo", 50 | "Apply": "Aplicar", 51 | "Apply and save": "Aplicar e salvar", 52 | "Create": "Criar", 53 | "Copy": "cópia de" 54 | } -------------------------------------------------------------------------------- /src/src/i18n/ru.json: -------------------------------------------------------------------------------- 1 | { 2 | "Select rule": "Выберите правило", 3 | "System": "Системные настройки", 4 | "Language": "язык", 5 | "Answer in id": "Ответ в ID", 6 | "Processor's id": "ID обработчика", 7 | "Timeout for processor": "Тайм-аут для обработчика", 8 | "Settings": "Настройки", 9 | "Cancel": "Отмена", 10 | "Test phrase": "Тестовая фраза", 11 | "Argument": "Параметр", 12 | "Confirmation text": "Текст подтверждения", 13 | "Keywords": "Ключевые слова", 14 | "Interrupt processing": "Прервать обработку", 15 | "You can use %s, that will be replaced with current value of state. %u will be replaced by unit": "Вы можете использовать %s, который будет заменен текущим значением состояния. %u будет заменено на единицы измерения", 16 | "Ok": "Ok", 17 | "Create Rule": "Создать правило", 18 | "Are you sure?": "Вы уверены?", 19 | "You want to delete: %s": "Вы хотите удалить: \"%s\"", 20 | "Refresh": "Обновить", 21 | "Remove rule": "Удалить правило", 22 | "Create rule": "Создать правило", 23 | "Search rule": "Найти правило", 24 | "lang_en": "английский", 25 | "lang_de": "Немецкий", 26 | "lang_ru": "русский", 27 | "ms": "мс", 28 | "Save": "Сохранить", 29 | "Do not interrupt processing": "Применять последующие правила", 30 | "Instance is not running": "Инстанция не запущена", 31 | "Create a new rule with a \"+\" on the left": "Создайте новое правило нажав на «+» слева", 32 | "Edit name or type of rule": "Изменить имя или тип правила", 33 | "New rule": "Новое правило", 34 | "Edit rule": "Изменить правило", 35 | "Rule": "правило", 36 | "Name": "Имя", 37 | "refresh": "Обновить", 38 | "Write to response by every command": "Записывать в состояние при любой команде", 39 | "Clone rule": "Клонировать правило", 40 | "Name already exist": "Имя уже существует", 41 | "Create new rule": "Создать новое правило", 42 | "Copy rule": "Копировать правило", 43 | "Please confirm or cancel changes before leaving": "Пожалуйста, подтвердите или отмените изменения", 44 | "You have changed rule": "Вы изменили правило", 45 | "Save and go": "Сохранить и идти", 46 | "Don't save and go": "Не сохранять и уйти", 47 | "Do not answer \"I don't understand\" if no rules found": "Не отвечать «Я не понимаю», если правила не найдены", 48 | "Convert 0/1 to false/true": "Преобразовать 0/1 в ложь/истину", 49 | "unsaved": "изменения", 50 | "Apply": "Применить", 51 | "Apply and save": "Применить и сохранить", 52 | "Create": "Создавать", 53 | "Copy": "Копировать" 54 | } -------------------------------------------------------------------------------- /src/src/i18n/uk.json: -------------------------------------------------------------------------------- 1 | { 2 | "unsaved": "незбережено", 3 | "Answer in id": "Відповідь в ID", 4 | "Are you sure?": "Ти впевнений?", 5 | "Argument": "Аргумент", 6 | "Cancel": "Скасувати", 7 | "Clone rule": "Клонуйте правило", 8 | "Confirmation text": "Текст підтвердження", 9 | "Convert 0/1 to false/true": "Перетворення 0/1 на false/true", 10 | "Copy rule": "Копіювати правило", 11 | "Create Rule": "Створити правило", 12 | "Create a new rule with a \"+\" on the left": "Створіть нове правило зі знаком «+» ліворуч", 13 | "Create new rule": "Створити нове правило", 14 | "Create rule": "Створити правило", 15 | "Do not answer \"I don't understand\" if no rules found": "Не відповідайте «Я не розумію», якщо не знайдено правил", 16 | "Do not interrupt processing": "Не переривайте обробку", 17 | "Don't save and go": "Не економте і йдіть", 18 | "Edit name or type of rule": "Відредагуйте назву або тип правила", 19 | "Edit rule": "Редагувати правило", 20 | "Instance is not running": "Екземпляр не запущено", 21 | "Interrupt processing": "Перервати обробку", 22 | "Keywords": "Ключові слова", 23 | "Language": "Мова", 24 | "Name": "Ім'я", 25 | "Name already exist": "Назва вже існує", 26 | "New rule": "Нове правило", 27 | "Ok": "В порядку", 28 | "Please confirm or cancel changes before leaving": "Будь ласка, підтвердьте або скасуйте зміни перед від'їздом", 29 | "Processor's id": "ID процесора", 30 | "Refresh": "Оновити", 31 | "Remove rule": "Видалити правило", 32 | "Rule": "правило", 33 | "Save": "зберегти", 34 | "Save and go": "Зберігай і йди", 35 | "Search rule": "Правило пошуку", 36 | "Select rule": "Виберіть правило", 37 | "Settings": "Налаштування", 38 | "System": "система", 39 | "Test phrase": "Тестова фраза", 40 | "Timeout for processor": "Час очікування для процесора", 41 | "Write to response by every command": "Пишіть відповідь на кожну команду", 42 | "You can use %s, that will be replaced with current value of state. %u will be replaced by unit": "Ви можете використовувати %s, який буде замінено поточним значенням стану. %u буде замінено на одиницю", 43 | "You have changed rule": "Ви змінили правило", 44 | "You want to delete: %s": "Ви хочете видалити: \"%s\"", 45 | "lang_de": "Німецький", 46 | "lang_en": "англійська", 47 | "lang_ru": "російський", 48 | "ms": "РС", 49 | "refresh": "Оновити", 50 | "Apply": "Застосувати", 51 | "Apply and save": "Застосуйте та збережіть", 52 | "Create": "Створити", 53 | "Copy": "Копіювати" 54 | } -------------------------------------------------------------------------------- /src/src/i18n/zh-cn.json: -------------------------------------------------------------------------------- 1 | { 2 | "Select rule": "选择规则", 3 | "System": "系统", 4 | "Language": "语言", 5 | "Answer in id": "输入答案", 6 | "Processor's id": "处理器ID", 7 | "Timeout for processor": "处理器超时", 8 | "Settings": "设置", 9 | "Cancel": "取消", 10 | "Test phrase": "测试词", 11 | "Argument": "论据", 12 | "Confirmation text": "确认文字", 13 | "Keywords": "关键词", 14 | "Interrupt processing": "中断处理", 15 | "You can use %s, that will be replaced with current value of state. %u will be replaced by unit": "您可以使用%s,它将替换为state的当前值。 %u将被单位替换", 16 | "Ok": "确定", 17 | "Create Rule": "建立规则", 18 | "Are you sure?": "你确定吗?", 19 | "You want to delete: %s": "您要删除:\"%s\"", 20 | "refresh": "刷新", 21 | "lang_en": "英语", 22 | "lang_de": "德语", 23 | "lang_ru": "俄语", 24 | "ms": "毫秒", 25 | "Remove rule": "删除规则", 26 | "Refresh": "刷新", 27 | "Search rule": "搜索规则", 28 | "Create rule": "建立规则", 29 | "Save": "保存", 30 | "Do not interrupt processing": "不要中断处理", 31 | "Instance is not running": "实例未运行", 32 | "Create a new rule with a \"+\" on the left": "用左侧的“ +”创建一个新规则", 33 | "Edit name or type of rule": "编辑名称或规则类型", 34 | "New rule": "新规定", 35 | "Edit rule": "修改规则", 36 | "Rule": "规则", 37 | "Name": "名称", 38 | "Write to response by every command": "通过每个命令写入响应", 39 | "Clone rule": "克隆规则", 40 | "Name already exist": "名称已存在", 41 | "Create new rule": "建立新规则", 42 | "Copy rule": "复制规则", 43 | "Please confirm or cancel changes before leaving": "请确认或取消更改,然后再离开", 44 | "You have changed rule": "您已更改规则", 45 | "Save and go": "保存并走", 46 | "Don't save and go": "不要保存并离开", 47 | "Do not answer \"I don't understand\" if no rules found": "如果没有找到规则,不要回答“我不明白”", 48 | "Convert 0/1 to false/true": "将 0/1 转换为假/真", 49 | "unsaved": "未保存", 50 | "Apply": "申请", 51 | "Apply and save": "应用并保存", 52 | "Create": "创造", 53 | "Copy": "复制" 54 | } -------------------------------------------------------------------------------- /src/src/index.css: -------------------------------------------------------------------------------- 1 | body, html { 2 | margin: 0; 3 | padding: 0; 4 | width: 100%; 5 | height: 100%; 6 | font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; 7 | overflow: hidden 8 | } 9 | /* scrollbar */ 10 | *::-webkit-scrollbar-track { 11 | background-color: #ccc; 12 | } 13 | *::-webkit-scrollbar { 14 | width: 6px; 15 | background-color: #ccc; 16 | } 17 | *::-webkit-scrollbar-thumb { 18 | background-color: #575757; 19 | } 20 | 21 | #root { 22 | height: 100%; 23 | } 24 | .App { 25 | min-height: 100%; 26 | height: -webkit-fit-content; 27 | height: -moz-fit-content; 28 | height: fit-content; 29 | } 30 | 31 | /* Right side */ 32 | 33 | /* Media */ 34 | 35 | /* @media screen and (max-width: 900px) { 36 | .right-bar__container { 37 | width: 80%; 38 | } 39 | .right-bar { 40 | padding: 0 10px; 41 | } 42 | } 43 | 44 | @media screen and (max-width: 530px) { 45 | .custom-card { 46 | flex-direction: column; 47 | } 48 | .right-bar .MuiFormControl-root { 49 | align-self: flex-start; 50 | margin-top: 10px; 51 | } 52 | } 53 | 54 | @media screen and (max-width: 400px) { 55 | } */ 56 | 57 | /* Media */ 58 | -------------------------------------------------------------------------------- /src/src/index.js: -------------------------------------------------------------------------------- 1 | import { createRoot } from 'react-dom/client'; 2 | import { ThemeProvider, StyledEngineProvider } from '@mui/material/styles'; 3 | import { StylesProvider, createGenerateClassName } from '@mui/styles'; 4 | 5 | import theme from '@iobroker/adapter-react-v5/Theme'; 6 | import Utils from '@iobroker/adapter-react-v5/Components/Utils'; 7 | 8 | import * as serviceWorker from './serviceWorker'; 9 | 10 | import './index.css'; 11 | import App from './App'; 12 | import pack from '../package.json'; 13 | 14 | window.adapterName = 'text2command'; 15 | window.sentryDSN = 'https://9806f910556240219f831ecfe2ee3ad1@sentry.iobroker.net/87'; 16 | let themeName = Utils.getThemeName(); 17 | 18 | console.log(`iobroker.${window.adapterName}@${pack.version} using theme "${themeName}"`); 19 | 20 | const generateClassName = createGenerateClassName({ 21 | productionPrefix: 'iob', 22 | }); 23 | 24 | function build() { 25 | const container = document.getElementById('root'); 26 | const root = createRoot(container); 27 | return root.render( 28 | 29 | 30 | { 32 | themeName = _theme; 33 | build(); 34 | }} 35 | /> 36 | 37 | 38 | ); 39 | } 40 | 41 | build(); 42 | 43 | // If you want your app to work offline and load faster, you can change 44 | // unregister() to register() below. Note this comes with some pitfalls. 45 | // Learn more about service workers: http://bit.ly/CRA-PWA 46 | serviceWorker.register(); 47 | -------------------------------------------------------------------------------- /test/mocha.setup.js: -------------------------------------------------------------------------------- 1 | process.on("unhandledRejection", (r) => { throw r; }); 2 | -------------------------------------------------------------------------------- /test/testFormatProvider.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var expect = require('chai').expect; 4 | //var setup = require(__dirname + '/lib/setup'); 5 | var formatProvider = require(__dirname + '/../lib/formatProvider'); 6 | var debug = true; 7 | 8 | describe('Commands: Test dateInterval without suffix in default language', function () { 9 | it('must return 2 minutes and 20 seconds', function (done) { 10 | let out= formatProvider.formatInterval(new Date().getTime() - 2 * 60 * 1000 - 20 * 1000 ); 11 | if (debug) console.log('formatInterval returned: ' + out); 12 | expect(out).is.equal('2 minutes and 20 seconds'); 13 | done(); 14 | }); 15 | 16 | it('must return 7 Minuten', function (done) { 17 | formatProvider.setLanguage("de"); 18 | let out= formatProvider.formatInterval(new Date().getTime() - 7 * 60 * 1000 - 20 * 1000 ); 19 | if (debug) console.log('formatInterval returned: ' + out); 20 | expect(out).is.equal('7 Minuten'); 21 | done(); 22 | }); 23 | }); 24 | 25 | describe('Commands: Test dateInterval with suffix in german language', function () { 26 | it('must return vor 3 Stunden und 2 Minuten', function (done) { 27 | let out= formatProvider.formatInterval(new Date().getTime() - 3 * 60 * 60 * 1000 - 2 * 60 * 1000 - 20 * 1000, true, "de" ); 28 | if (debug) console.log('formatInterval returned: ' + out); 29 | expect(out).is.equal('vor 3 Stunden und 2 Minuten'); 30 | done(); 31 | }); 32 | 33 | it('must return vor 5 Tagen', function (done) { 34 | let out= formatProvider.formatInterval(new Date().getTime() - 5 * 24 * 60 * 60 * 1000 - 7 * 60 * 1000 - 20 * 1000, true, "de" ); 35 | if (debug) console.log('formatInterval returned: ' + out); 36 | expect(out).is.equal('vor 5 Tagen'); 37 | done(); 38 | }); 39 | 40 | it('must return vor einem Tag', function (done) { 41 | let out= formatProvider.formatInterval(new Date().getTime() - 1 * 24 * 60 * 60 * 1000 - 7 * 60 * 1000 - 20 * 1000, true, "de" ); 42 | if (debug) console.log('formatInterval returned: ' + out); 43 | expect(out).is.equal('vor einem Tag'); 44 | done(); 45 | }); 46 | }); 47 | --------------------------------------------------------------------------------