Giter Site home page Giter Site logo

homebridge-dreo about verified HOT 12 CLOSED

zyonse avatar zyonse commented on July 25, 2024
homebridge-dreo

from verified.

Comments (12)

github-actions avatar github-actions commented on July 25, 2024

Pre-checks completed successfully.

from verified.

bwp91 avatar bwp91 commented on July 25, 2024

Hi @zyonse

Installing the plugin and immediately clicking save in the homebridge ui resulted in this config:

        {
            "options": {},
            "name": "Dreo Platform",
            "platform": "DreoPlatform"
        }

and I had to disable the plugin since it sent my homebridhe into a restart loop:

[25/04/2023, 04:27:11] Homebridge v2.0.0-beta.1 (HAP v1.0.0-beta.8) (Homebridge) is running on port 51781.
[25/04/2023, 04:27:12] TypeError: Cannot read properties of undefined (reading 'access_token')
    at DreoPlatform.discoverDevices (/usr/local/lib/node_modules/homebridge-dreo/src/platform.ts:61:61)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)

Please ensure that all errors are caught properly by the plugin so it does not affect the running of other plugins!

Please also check things like the following just to make sure your plugin handles them correctly:

  • an email address is provided in the config but the password is left blank
  • an email address is provided with a password which is incorrect

Of course it's totally okay that your plugin logs an error in these cases - so long as the user can look at the logs and understand what has gone wrong - and most importantly your plugin can stop working without affecting other plugins that a user may have installed.

from verified.

zyonse avatar zyonse commented on July 25, 2024

@bwp91 Thanks for the feedback and suggestions. I added some actual error handling with console messages to address those login issues, they're included in v1.2.0 of the plugin.

from verified.

zyonse avatar zyonse commented on July 25, 2024

/check

from verified.

github-actions avatar github-actions commented on July 25, 2024

Pre-checks completed successfully.

from verified.

bwp91 avatar bwp91 commented on July 25, 2024

Great, for the purposes of verification, the change you have made is perfect.

However, just wanted to query a real-case usage situation, as I noticed that if user/pass is incorrect you remove all the devices:


    if (email === undefined || password === undefined) {
      this.api.unregisterPlatformAccessories(
        PLUGIN_NAME,
        PLATFORM_NAME,
        this.accessories,
      );
      this.log.error('error: Invalid email and/or password');
      return;
    }

Let's say a user has 10 devices with a dreo account and then changes their password in the app. They then restart homebridge without remembering to update their password in homebridge and suddenly all their devices have been removed! would it not be better to just return; without removing devices? just a thought 😀

Will also post a checklist now as there is one other thing I have noticed with regards to github releases

from verified.

github-actions avatar github-actions commented on July 25, 2024
  • - The plugin must successfully install.
  • - The plugin must implement the Homebridge Plugin Settings GUI.
  • - The plugin must not start unless it is configured.
  • - The plugin must not execute post-install scripts that modify the user's system in any way.
  • - The plugin must not contain any analytics or calls that enable you to track the user.
  • - The plugin must not throw unhandled exceptions, the plugin must catch and log its own errors.
  • - The plugin must be published to npm and the source code available on GitHub.
  • - GitHub releases should be created for every new version of your plugin, with patch notes.
  • - The plugin must run on all Active LTS versions of Node.js, at the time of writing this is Node.js v14, v16 and v18.
  • - The plugin must not require the user to run Homebridge in a TTY or with non-standard startup parameters, even for initial configuration.
  • - If the plugin needs to write files to disk (cache, keys, etc.), it must store them inside the Homebridge storage directory.

Please remember to create a github release with each version of the plugin you release - as this is the information that is shown in the homebridge ui when a user updates the plugin

https://github.com/zyonse/homebridge-dreo/releases

from verified.

bwp91 avatar bwp91 commented on July 25, 2024

...also that for example an npm release of 1.0.0 should have a github tag of v1.0.0

from verified.

zyonse avatar zyonse commented on July 25, 2024

Let's say a user has 10 devices with a dreo account and then changes their password in the app. They then restart homebridge without remembering to update their password in homebridge and suddenly all their devices have been removed! would it not be better to just return; without removing devices? just a thought 😀

The code you referenced would only be triggered if the user removed their username or password from the config file. If they changed their account password in the Dreo app without updating it in homebridge, the plugin would receive an invalid access_token and just 'return;'

https://github.com/zyonse/homebridge-dreo/blob/1e3118c958c6c3ec207fc2a27d6bca47d43bfd53/src/platform.ts#L71-L76

Also, just added a github release for the latest npm version.

from verified.

bwp91 avatar bwp91 commented on July 25, 2024

Apologies yes you are correct - I misread the code! All with good intentions! Fab - please continue with the github releases and i will verify the plugin now 😁

from verified.

github-actions avatar github-actions commented on July 25, 2024

Congratulations! Your plugin has been verified.

You can now add the Verified by Homebridge badge to your plugin's README:

verified-by-homebridge

[![verified-by-homebridge](https://badgen.net/badge/homebridge/verified/purple)](https://github.com/homebridge/homebridge/wiki/Verified-Plugins)

Your plugin is now also eligible to display a ❤️ Donate button on its tile in the Homebridge UI. See https://github.com/oznu/homebridge-config-ui-x/wiki/Developers:-Donation-Links for instructions.

If for any reason in the future you can no longer maintain your plugin, please consider transferring it to our unmaintained plugins repo. We can take ownership until another willing developer comes along.

Thank you for your contribution to the Homebridge Community.
https://homebridge.io

from verified.

zyonse avatar zyonse commented on July 25, 2024

Will do, thank you!

from verified.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.