kirichkov / home_assistant-ble

Companion application for home-assistant, sending bluetooth low energy detection
21 stars 4 forks source link

Bugfix for crash when only home_assistant_devices_file is defined #2

Closed kirichkov closed 7 years ago

kirichkov commented 7 years ago

When only home_assistant_devices_file is defined without any home_assistant_devices defined, or the whole section is omitted this causes a crash.

Also adds instructions on the necessary packages for raspbian

kirichkov commented 7 years ago

Have you pushed your fix? If so I'll pull, rebate and push again. I noticed the conflict but it was a bit too late and it wasn't obvious where the conflict was.

kirichkov commented 7 years ago

I've rebased on top of the current master.

Rubocop fails with lib/home_assistant/ble.rb:60:9: C: Redundant return detected. but that's simply wrong. If you omit the return and home_assistant_devices is missing or empty it will return nil, ignoring the devices from known_devices.yaml.

kamaradclimber commented 7 years ago

Hello georgi Im part of a hackathon at work these days I probably won't be able to look at your patch today. I'll try to help you this weekend if possible

Le jeu. 30 mars 2017 13:36, Georgi Kirichkov notifications@github.com a écrit :

I've rebased on top of the current master.

Rubocop fails with lib/home_assistant/ble.rb:60:9: C: Redundant return detected. but that's simply wrong. If you omit the return and home_assistant_devices is missing or empty it will return nil, ignoring the devices from known_devices.yaml.

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/kamaradclimber/home_assistant-ble/pull/2#issuecomment-290384986, or mute the thread https://github.com/notifications/unsubscribe-auth/AAeu8X8O7UmPrYVeGkZ3LgiinoMTL4ujks5rq5PLgaJpZM4MtkwC .

kamaradclimber commented 7 years ago

I've just had a look and don't understand how new rubocop violation can appear. I'll merge your patch and fix them right away

kamaradclimber commented 7 years ago

Thanks a lot for the patch

kamaradclimber commented 7 years ago

pushed as 1.3.1

kirichkov commented 7 years ago

I've tried briefly linting some other code with rubocop and figured out it's nowhere near the level of python linters and statuc code analyzers. It quite often suggests changes that break your code, as is this case. In order to satisfy the error I introduced it would require to rewrite your perfectly working code. Linters and analyzers should help you write better code, not adjust your code according to their whims :-)

Good luck at the hackathon!