{"id":13411188,"url":"https://github.com/mariomka/yi-action-camera","last_synced_at":"2025-03-14T16:34:10.460Z","repository":{"id":57403701,"uuid":"67361612","full_name":"mariomka/yi-action-camera","owner":"mariomka","description":"Yi Action Camera module for node","archived":true,"fork":false,"pushed_at":"2019-11-13T21:43:55.000Z","size":14,"stargazers_count":60,"open_issues_count":2,"forks_count":10,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-10-02T11:47:20.274Z","etag":null,"topics":["nodejs","yi-action-camera"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mariomka.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-09-04T18:29:34.000Z","updated_at":"2024-09-25T14:32:53.000Z","dependencies_parsed_at":"2022-08-26T01:21:11.257Z","dependency_job_id":null,"html_url":"https://github.com/mariomka/yi-action-camera","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mariomka%2Fyi-action-camera","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mariomka%2Fyi-action-camera/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mariomka%2Fyi-action-camera/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mariomka%2Fyi-action-camera/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mariomka","download_url":"https://codeload.github.com/mariomka/yi-action-camera/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243610935,"owners_count":20319053,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["nodejs","yi-action-camera"],"created_at":"2024-07-30T20:01:12.024Z","updated_at":"2025-03-14T16:34:10.159Z","avatar_url":"https://github.com/mariomka.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# yi-action-camera\n\n[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE)\n[![Latest Version on NPM](https://img.shields.io/npm/v/yi-action-camera.svg?style=flat-square)](https://npmjs.com/package/yi-action-camera)\n[![npm](https://img.shields.io/npm/dt/yi-action-camera.svg?style=flat-square)](https://www.npmjs.com/package/yi-action-camera)\n\n\u003e Yi Action Camera module for node.\n\nTested on Xiaomi Yi Action Camera (Not Yi 4K)\n\n## Install\n\n```shell\nnpm install --save yi-action-camera\n```\n\n## Usage\n\nFirst of all connect Xiaomi Yi Action Camera via WiFi.\n\nDefault password is `1234567890`.\n\n```js\nconst yi = require('yi-action-camera');\n\nyi.connect()\n    .then(function () {\n        console.log('connected');\n\n        return yi.takePhoto();\n    })\n    .then(function (filePath) {\n        console.log('photo', filePath);\n\n        return yi.downloadFile(filePath);\n    })\n    .then(function (filePath) {\n        console.log('photo downloaded', filePath);\n\n        return yi.disconnect();\n    })\n    .then(function () {\n        console.log('disconnected');\n    })\n    .catch(function (err) {\n        console.error(err);\n    });\n```\n\n## Settings\n\n### autoConnect\nDefault: `true`\n\n### ip\nDefault: `192.168.42.1`\n\n### port\nDefault: `7878`\n\n## API Reference\n\n### connect()\nConnect to camera.\n\nReturns `Promise`\n\n### disconnect()\nClose connection to camera.\n\nReturns `Promise`\n\n### takePhoto()\nTake a photo.\n\nReturns `Promise`\n\n### startRecord()\nStart video recording.\n\nReturns `Promise`\n\n### stopRecord()\nStop video recording.\n\nReturns `Promise`\n\n### startStream()\nStart live stream by url (Default ip: `192.168.42.1`)\n```rtsp://${ip}/live```\n\nReturns `Promise`\n\n### stopStream()\nStop live stream\n\nReturns `Promise`\n\n### getConfig()\nGet camera config.\n\nReturns `Object`\n\n### setConfig(type, value)\nSet camera config. See [configuration values](#configuration-values).\n\n#### type\nRequired\n\nType: `string`\n\n#### value\nRequired\n\nType: `string`\n\nReturns `Promise`\n\n### downloadFile(filePath, outputPath)\nDownload a file from camera.\n\n#### filePath\nRequired\n\nType: `string`\n\nAbsolute camera file path.\n\n#### outputPath\nOptional\n\nType: `string`\n\nDefault: `./`\n\nOutput host file path.\n\nReturns `Promise`\n\n### deleteFile(filePath)\nDelete a file from camera.\n\n#### filePath\nRequired\n\nType: `string`\n\nAbsolute camera file path.\n\nReturns `Promise`\n\n## Configuration values\nYou can check all config types and values in [constant.js](constant.js) and access it through `yi.config`.\n\n## License\n\nMIT © [Mario Juárez](https://github.com/mariomka)\n\n## It couldn't be possible without:\n\n- https://dashcamtalk.com/forum/threads/xiaomi-yi-camera-gui-control-configure-from-pc-win-lin-mac.11206/\n- https://copter.sovgvd.info/a/Xiaomi-Yi-protocol-remote-control\n- http://pastebin.com/yKvXyyp8\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmariomka%2Fyi-action-camera","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmariomka%2Fyi-action-camera","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmariomka%2Fyi-action-camera/lists"}