Comments (4)
Thank you for the detailed issue 🙇
I am somewhat cautious to add back in a Node.js specific library here, as this library is used in the browser as well as on Node.js code bases.
To satisfy the needs IPv6 support do you have knowledge in advance that you have an IPv6 address, or is this more open and you are providing a hostname, IPv4 or IPv6 address to the library in your use case?
from node-hue-api.
I did not realise this was also used in the browser, so then i can understand the choice to remove it. Specifying the address family could be an option, but that presents a breaking API change (but that might be fine because this is 5.0.0). That will move the address family detection into my responsibility. But that still requires a change in node-hue-api, as baseUrl
will need to be constructed with square brackets, and hostname
without.
We have 3 possible inputs. An IPv4 address, an IPv6 address and a DNS hostname. We need to add brackets for the IPv6 address. Detecting these would not be to complicated, as a colon is only valid for an IPv6 address (and not for v4 or DNS). So we could simply check if an IPv6 address is given by checking .indexOf(':') !== -1
, and adding square brackets if that's the case.
An other alternative would be to add a minor dependency on https://github.com/sindresorhus/ip-regex. But i do realise node-hue-api has very little dependencies currently, and keeping it that way is nice. But an ipv6 regex could be borrowed from that repository, as their license allows it.
My personal preference would go against specifying the address family, and in favor of the other two options.
from node-hue-api.
I have just made the changes to v5.0.0-beta.9
which is published to the npm registry to be picked up.
I have added handling for the hostname
to support all forms of IPv6 including if you happened to wrap it in []
s. Can you try this out @jeffreykog and report back if it is working for you 🙇 ?
from node-hue-api.
@peter-murray Awesome! I have tested it with an ipv4 literal address, ipv6 literal address and a hostname, and it all seems to work. Closing this 🎉
from node-hue-api.
Related Issues (20)
- Error when using Webpack / Electron HOT 1
- Example typo
- Touchlink activation HOT 1
- Cant get this to work with React.JS HOT 2
- Export as esm module HOT 20
- mDNS Discovery HOT 4
- ApiError: Problems resolving hue bridges, HTTP error status: 429 HOT 15
- Cannot import createLocal using TypeScript HOT 3
- Example doesn't work HOT 2
- api.sensors.updateSensorConfig not working due to un-settable params included in request HOT 3
- Failed to create sensor from bridge model: Error: Unknown type 'zllrelativerotary' to create Bridge Model Object HOT 3
- MDNS Discovery not working (Empty Array) HOT 12
- Implement RGB support for groups HOT 1
- Hue API V2
- ApiError: Problems resolving hue bridges, HTTP error status: 429 HOT 1
- bridge-validation.ts is missing bridgeid
- setLightState sets bri to 1 [esmodules] HOT 1
- Cannot be used in browser due to a minor issue
- Please make Rate Limiting configurable HOT 3
- Getting Value, '65520' is not within allowed limits: min=-255 max=255 for 'id' when using Philips Hue-Bridge adapter in iobroker
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-hue-api.