{"id":15391971,"url":"https://github.com/dhleong/wemore","last_synced_at":"2025-04-15T23:26:39.223Z","repository":{"id":18804434,"uuid":"22018691","full_name":"dhleong/wemore","owner":"dhleong","description":"A more awesome library for Belkin WeMo interactions","archived":false,"fork":false,"pushed_at":"2022-12-07T17:49:53.000Z","size":66,"stargazers_count":37,"open_issues_count":5,"forks_count":12,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-04-14T19:24:24.344Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dhleong.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-07-19T20:27:33.000Z","updated_at":"2024-03-30T19:03:56.000Z","dependencies_parsed_at":"2023-01-11T19:58:08.880Z","dependency_job_id":null,"html_url":"https://github.com/dhleong/wemore","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dhleong%2Fwemore","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dhleong%2Fwemore/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dhleong%2Fwemore/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dhleong%2Fwemore/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dhleong","download_url":"https://codeload.github.com/dhleong/wemore/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239937701,"owners_count":19721482,"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":[],"created_at":"2024-10-01T15:13:38.653Z","updated_at":"2025-02-28T19:30:33.702Z","avatar_url":"https://github.com/dhleong.png","language":"JavaScript","funding_links":[],"categories":["Protocol Library"],"sub_categories":["WeMo"],"readme":"wemore\n======\n\nA more awesome library for Belkin WeMo interactions. With acknowledgements to \n[wemo.js](https://github.com/thatguydan/wemo.js.git) for protocol reference.\n\n### Usage\n\n[![NPM](https://nodei.co/npm/wemore.png?mini=true)](https://nodei.co/npm/wemore/)\n\nToggle the first device found:\n\n```javascript\nvar wemore = require('wemore')\n\n// with no args, a Discovery object is returned\n//  that emits device events as they're discovered\nvar discovery = wemore.Discover()\n.on('device', function(device) {\n    device.toggleBinaryState();\n    discovery.close(); // stop discovering\n});\n```\n\nToggling a device by its friendly name:\n\n```javascript\nvar wemore = require('wemore')\n\n// when the friendly name is provided, a Promise is returned\nwemore.Discover('Lights')\n.then(function(device) {\n    return device.toggleBinaryState();\n})\n.then(function() {\n    console.log(\"Success!\");\n})\n.fail(function(err) {\n    console.error(\"Couldn't find device\", err);\n});\n\n```\n\n#### Emulate Devices\n\nWemore also provides a facility for emulating devices, allowing you to\ntransparently respond to toggle events from another device on the network,\nlike perhaps the Amazon Echo.\n\n```javascript\nvar wemore = require('wemore');\n\n// note that each device needs a separate port:\nvar tv = wemore.Emulate({friendlyName: \"TV\", port: 9001}); // choose a port\nvar stereo = wemore.Emulate({friendlyName: \"Stereo\"}); // automatically assigned\n\nstereo.on('listening', function() {\n    // if you want it, you can get it:\n    console.log(\"Stereo listening on\", this.port);\n});\n\ntv.on('state', function(binaryState, self, sender) {\n    console.log(\"TV set to=\", binaryState);\n    tv.close(); // stop advertising the device\n});\n\n// also, 'on' and 'off' events corresponding to binary state\nstereo.on('on', function(self, sender) {\n    console.log(\"Stereo turned on\");\n});\n\nstereo.on('off', function(self, sender) {\n    console.log(\"Stereo turned off\");\n});\n```\n\nIf you need information about who requested the event, it is provided as a\n\"Sender object\" that looks something like this:\n\n```javascript\n{\n    address: '::ffff:192.168.1.23',\n    port: 12345\n}\n```\n\nSee [Socket.remoteAddress](https://nodejs.org/api/net.html#net_socket_remoteaddress)\nfor more information about these values.\n\n### Binary\n\nInstalling with `-g` provides the `wemore-toggle` executable:\n\n```\nusage: wemore-toggle \u003cfriendlyName\u003e\n```\n\nIt's simply a wrapper around the \"toggle by friendly name\" example above.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdhleong%2Fwemore","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdhleong%2Fwemore","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdhleong%2Fwemore/lists"}