Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[chromecast] Refactoring of binding #7367

Merged
merged 6 commits into from
Apr 18, 2020

Conversation

cweitkamp
Copy link
Contributor

  • Refactoring of binding

Some stuff lying around in my branches.

Signed-off-by: Christoph Weitkamp github@christophweitkamp.de

Copy link
Member

@wborn wborn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't done a thorough review, though from what I saw most looks very good! 👍

@@ -17,6 +17,8 @@ thing-type.config.chromecast.device.ipAddress.label = IP-Adresse
thing-type.config.chromecast.device.ipAddress.description = Lokale IP-Adresse oder Hostname des Chromecast Ger�tes.
thing-type.config.chromecast.device.port.label = Port
thing-type.config.chromecast.device.port.description = Port des Chromecast Ger�tes.
thing-type.config.chromecast.device.refreshRate.label = Aktualisierungsintervall
thing-type.config.chromecast.device.refreshRate.description = Intervall zur Aktualisierung des Chromecast Ger�tes.

# channel types
channel-type.kodi.stop.label = Stop
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I should change this mistake too.

Comment on lines +291 to +298
final MessageDigest md = MessageDigest.getInstance(MD5_ALGORITHM);
return String.format("%032x", new BigInteger(1, md.digest(key.getBytes(StandardCharsets.UTF_8))));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Surely there are simpler ways to generate a unique file name than using an MD5 hash. Wouldn't the hashcode of the key suffice?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since you use this code in other bindings I'm assuming that it wouldn't be worth changing this...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changing it here should be okay. But changing it in other bindings will result in "data loss" (data ist still there but not taken into account anymore). I am pretty sure there is no better way than using String.hashCode() method at all.

Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
@cweitkamp cweitkamp force-pushed the feature-chromecast-refactoring branch from cda5702 to 41c8294 Compare April 16, 2020 10:39
Copy link
Contributor

@cpmeister cpmeister left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good enough

@cpmeister cpmeister merged commit 954422e into openhab:2.5.x Apr 18, 2020
@cpmeister cpmeister added this to the 2.5.4 milestone Apr 18, 2020
@cweitkamp cweitkamp deleted the feature-chromecast-refactoring branch April 18, 2020 17:40
@cweitkamp cweitkamp added the enhancement An enhancement or new feature for an existing add-on label Apr 26, 2020
yfre pushed a commit to yfre/openhab-addons that referenced this pull request Apr 27, 2020
* Refactoring of binding
* Incorporated comments from review

Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
Signed-off-by: Eugen Freiter <freiter@gmx.de>
markus7017 pushed a commit to markus7017/openhab-addons that referenced this pull request May 29, 2020
* Refactoring of binding
* Incorporated comments from review

Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
LoungeFlyZ pushed a commit to LoungeFlyZ/openhab2-addons that referenced this pull request Jun 8, 2020
* Refactoring of binding
* Incorporated comments from review

Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
J-N-K pushed a commit to J-N-K/openhab-addons that referenced this pull request Jul 14, 2020
* Refactoring of binding
* Incorporated comments from review

Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
CSchlipp pushed a commit to CSchlipp/openhab-addons that referenced this pull request Jul 26, 2020
* Refactoring of binding
* Incorporated comments from review

Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
Signed-off-by: CSchlipp <christian@schlipp.de>
andrewfg pushed a commit to andrewfg/openhab-addons that referenced this pull request Aug 31, 2020
* Refactoring of binding
* Incorporated comments from review

Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
andrewfg pushed a commit to andrewfg/openhab-addons that referenced this pull request Aug 31, 2020
* Refactoring of binding
* Incorporated comments from review

Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
andrewfg pushed a commit to andrewfg/openhab-addons that referenced this pull request Aug 31, 2020
* Refactoring of binding
* Incorporated comments from review

Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
andrewfg pushed a commit to andrewfg/openhab-addons that referenced this pull request Aug 31, 2020
* Refactoring of binding
* Incorporated comments from review

Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
DaanMeijer pushed a commit to DaanMeijer/openhab-addons that referenced this pull request Sep 1, 2020
* Refactoring of binding
* Incorporated comments from review

Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
Signed-off-by: Daan Meijer <daan@studioseptember.nl>
markus7017 pushed a commit to markus7017/openhab-addons that referenced this pull request Sep 19, 2020
* Refactoring of binding
* Incorporated comments from review

Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An enhancement or new feature for an existing add-on
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants