{"id":15962237,"url":"https://github.com/albertogeniola/dlinkw215","last_synced_at":"2025-09-09T01:38:52.696Z","repository":{"id":96744954,"uuid":"145331892","full_name":"albertogeniola/DLinkW215","owner":"albertogeniola","description":null,"archived":false,"fork":false,"pushed_at":"2018-08-21T20:08:06.000Z","size":40,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-09T01:38:52.446Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C#","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/albertogeniola.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-08-19T19:31:55.000Z","updated_at":"2018-08-21T20:08:08.000Z","dependencies_parsed_at":null,"dependency_job_id":"a9104e52-2dd7-4944-92ec-6c967a1e517c","html_url":"https://github.com/albertogeniola/DLinkW215","commit_stats":{"total_commits":13,"total_committers":3,"mean_commits":4.333333333333333,"dds":"0.46153846153846156","last_synced_commit":"63be527e6f9c7f63316a4664c254f453b1e8c575"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/albertogeniola/DLinkW215","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/albertogeniola%2FDLinkW215","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/albertogeniola%2FDLinkW215/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/albertogeniola%2FDLinkW215/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/albertogeniola%2FDLinkW215/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/albertogeniola","download_url":"https://codeload.github.com/albertogeniola/DLinkW215/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/albertogeniola%2FDLinkW215/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274232030,"owners_count":25245856,"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","status":"online","status_checked_at":"2025-09-08T02:00:09.813Z","response_time":121,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-07T16:02:10.783Z","updated_at":"2025-09-09T01:38:52.674Z","avatar_url":"https://github.com/albertogeniola.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"﻿# DLinkW215\nThis is a C# port of the nice [pyW215](https://github.com/LinuxChristian/pyW215) \npython library for the DLink W215 smart plug. Credits go to both @LinuxChristian and \nto @bikerp, who both contributed to the creation of respectively Python and Javascript\nimplementations.\n\nJust to be clear, the following is the PowerPlug we are talking about:\n\n![DLink W215 power plug image](https://github.com/albertogeniola/DLinkW215/blob/master/41G5fawxPoL.jpg)\n\n## Installation\nIn order to use this library in your projects, you might either reference the package via NuGet or download the project and reference the library externally. \n\nI strongly recommend to use NuGet package manager to do so. The package has been pushed on NuGet repository: https://www.nuget.org/packages/DLinkW215/.\n\nFrom the package manager console:\n\n    PM\u003e Install-Package DLinkW215 -Version 0.0.2\n\nOr from .NET CLI\n\n    \u003e dotnet add package DLinkW215 --version 0.0.2\n\nOr from Packet CLI\n\n    \u003e paket add DLinkW215 --version 0.0.2\n\n## Usage\nThe library is pretty easy to use:\n    \n```cs\n// The first parameter is the IP address of the power plug\n// while the second one is the ACCESS CODE printed on the plug itself\nvar plug = new DLinkW215SmartPlug(\"192.168.1.9\", \"123456\");\n\n// Returns the current power switch state    \nvar state = plug.GetState(); \n\n// Return the current power consumption in Watts. If an error occurred, null is returned.\nvar powerConsumption = plug.GetCurrentConsumption();\nif (powerConsumption==null)\n    Console.Out.WriteLine(\"Current consumption is \" + powerConsumption + \" Watts\");\nelse\n    Console.Out.WriteLine(\"An error occurred and it was not possible to read the power consumtpion from the device\");\n\n// Same thing happens for the following:\n// plug.GetTotalConsumption()\n// plug.GetTemperature() // In Celsius!\n\n// Turn the switch On\nplug.SetState(DLinkW215.DLinkW215SmartPlug.On);\n\n// Turn the switch Off\nplug.SetState(DLinkW215.DLinkW215SmartPlug.Off);\n```\n    \n\n## Notes and known issues\nThe library works as expected, however no verbose error handling system has been implemented. This means that, if there is something wrong, exception are not well handled. Most of the APIs will simply catch any exception and return null instead. \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falbertogeniola%2Fdlinkw215","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falbertogeniola%2Fdlinkw215","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falbertogeniola%2Fdlinkw215/lists"}