profile
viewpoint
Colin Harrington ColinHarrington Laelfrog Inc Minnesota Developer, Software Consultant, Maker

ColinHarrington/async-workshop 4

Grails Async Workshop shell

ColinHarrington/arduino-linux64 3

64 bit Linux install of Arduino for debugging purposes

ColinHarrington/debian-tomcat-scripts 3

Debian Tomcat Scripts for running Multiple tomcats (adapted from google code)

ColinHarrington/arduinomidilib 2

Arduino Midi Lib

ColinHarrington/grails-core 2

The Grails Web Application Framework

ColinHarrington/2gx-grails-layouts-demo 1

Grails Layouts & Sitemesh demo

ColinHarrington/CommandObjectExample 1

An example for a Stack overflow question

ColinHarrington/geb 1

Very Groovy Browser Automation

ColinHarrington/grails-async 1

grails-async presentation

startedfoxlet/macOS-Simple-KVM

started time in 18 days

PublicEvent

pull request commentdenoland/deno

reland "fix(cli): ipv6 parsing for --allow-net params (#6453)"

Thanks for re-landing this PR! @bartlomieju Does Issue 5518 need to stay open now that it's merged?

bartlomieju

comment created time in a month

Pull request review commenthome-assistant/core

Add Plum Lightpad config flow

     extra=vol.ALLOW_EXTRA, ) +PLATFORMS = ["light"] -async def async_setup(hass, config):++async def async_setup(hass: HomeAssistant, config: dict):     """Plum Lightpad Platform initialization."""+    if DOMAIN not in config:+        return True      conf = config[DOMAIN]-    plum = Plum(conf[CONF_USERNAME], conf[CONF_PASSWORD]) -    hass.data[DOMAIN] = plum+    _LOGGER.info("Found Plum Lightpad configuration in config, importing...")+    hass.async_create_task(+        hass.config_entries.flow.async_init(+            DOMAIN, context={"source": SOURCE_IMPORT}, data=conf+        )+    ) -    def cleanup(event):-        """Clean up resources."""-        plum.cleanup()+    return True -    hass.bus.async_listen_once(EVENT_HOMEASSISTANT_STOP, cleanup) -    cloud_web_sesison = async_get_clientsession(hass, verify_ssl=True)-    await plum.loadCloudData(cloud_web_sesison)--    async def new_load(device):-        """Load light and sensor platforms when LogicalLoad is detected."""-        await asyncio.wait(-            [-                hass.async_create_task(-                    discovery.async_load_platform(-                        hass, "light", DOMAIN, discovered=device, hass_config=conf-                    )-                )-            ]-        )+async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry):+    """Set up Plum Lightpad from a config entry."""+    _LOGGER.debug("Setting up config entry with ID = %s", entry.unique_id) -    async def new_lightpad(device):-        """Load light and binary sensor platforms when Lightpad detected."""-        await asyncio.wait(-            [-                hass.async_create_task(-                    discovery.async_load_platform(-                        hass, "light", DOMAIN, discovered=device, hass_config=conf-                    )-                )-            ]-        )+    username = entry.data.get(CONF_USERNAME)+    password = entry.data.get(CONF_PASSWORD) -    device_web_session = async_get_clientsession(hass, verify_ssl=False)-    hass.async_create_task(-        plum.discover(-            hass.loop,-            loadListener=new_load,-            lightpadListener=new_lightpad,-            websession=device_web_session,+    try:+        plum = await load_plum(username, password, hass)+    except ContentTypeError as ex:+        _LOGGER.error("Unable to authenticate to Plum cloud: %s", ex)+        return False+    except (ConnectTimeout, HTTPError) as ex:+        _LOGGER.error("Unable to connect to Plum cloud: %s", ex)+        raise ConfigEntryNotReady++    hass.data.setdefault(DOMAIN, {})+    hass.data[DOMAIN][entry.entry_id] = plum++    for component in PLATFORMS:+        hass.async_create_task(+            hass.config_entries.async_forward_entry_setup(entry, component)         )-    ) +    def cleanup(event):+        """Clean up resources."""+        plum.cleanup()

@MartinHjelmare We can take on fixing the underlying library too. What would you like changed?

Currently each lightpad starts it's own thread which receives change events (motion, power, config, etc.) currently using telnetlib and threading.

The plum.cleanup() function shuts down those threads.

I'd like to have those open tcp connections asyncio driven. What's the desired model here? Is it expected that underlying lib would start it's own event loop or join home assistant's main loop?

The discovery process/UDP endpoint is created in the event loop passed in (: https://github.com/ColinHarrington/plum-lightpad-python/blob/master/plumlightpad/plumlightpad.py#L59-L71

prystupa

comment created time in a month

pull request commentdenoland/deno

Revert "fix(cli): ipv6 parsing for --allow-net params (#6453)"

I don't think this is necessarily related to #6453. It seems to be that the ci build with macOS-latest has some instability.

My first version of the PR died with a SIGSEGV: invalid memory reference I amended just the commit message - no changes to the code and the build passed. I wrote it off as build instability with the macOS-latest build.

I'm seeing a number of ci runs dying on test_release macOS-latest with similar issues, including failures prior to my PR.

  • https://github.com/denoland/deno/runs/803752521?check_suite_focus=true Caused by: process didn't exit successfully: /Users/runner/runners/2.263.0/work/deno/deno/target/release/deps/deno-155067cc6f246010 (signal: 6, SIGABRT: process abort signal) ##[error]Process completed with exit code 101.

  • https://github.com/denoland/deno/runs/803741363?check_suite_focus=true Caused by: process didn't exit successfully: /Users/runner/runners/2.263.0/work/deno/deno/target/release/deps/deno-155067cc6f246010 (signal: 11, SIGSEGV: invalid memory reference) ##[error]Process completed with exit code 101.

  • https://github.com/denoland/deno/runs/803589580?check_suite_focus=true Caused by: process didn't exit successfully: /Users/runner/runners/2.263.0/work/deno/deno/target/release/deps/deno-155067cc6f246010 (signal: 11, SIGSEGV: invalid memory reference) ##[error]Process completed with exit code 101.

  • https://github.com/denoland/deno/runs/804251920?check_suite_focus=true process didn't exit successfully: /Users/runner/runners/2.263.0/work/deno/deno/target/release/deps/deno-155067cc6f246010 (signal: 4, SIGILL: illegal instruction)

  • https://github.com/denoland/deno/runs/800973207?check_suite_focus=true (Before the merge of #6453 ) Caused by: process didn't exit successfully: /Users/runner/runners/2.263.0/work/deno/deno/target/release/deps/deno-155067cc6f246010 (signal: 11, SIGSEGV: invalid memory reference) ##[error]Process completed with exit code 101.

  • https://github.com/denoland/deno/runs/790981909?check_suite_focus=true (from 5 days ago) Caused by: process didn't exit successfully: /Users/runner/runners/2.263.0/work/deno/deno/target/release/deps/deno-155067cc6f246010 (signal: 11, SIGSEGV: invalid memory reference) ##[error]Process completed with exit code 101.

bartlomieju

comment created time in a month

Pull request review commenthome-assistant/core

Add Plum Lightpad config flow

 homeassistant/components/plaato/* @JohNan homeassistant/components/plant/* @ChristianKuehnel homeassistant/components/plex/* @jjlawren homeassistant/components/plugwise/* @CoMPaTech @bouwew-homeassistant/components/plum_lightpad/* @ColinHarrington+homeassistant/components/plum_lightpad/* @ColinHarrington @prystupa

Looks great. Ok to merge when last comments addressed!

Thumbs up from me: Thank you @prystupa!

prystupa

comment created time in a month

push eventColinHarrington/deno

Colin Harrington

commit sha 8cbe4b50320d5fd22db2d68f8541f644ea09c6c8

Added Tests and fixes written by @jinliming2 in https://github.com/denoland/deno/pull/5520

view details

Colin Harrington

commit sha 208fb44df9d19923a989abe03066b85972b24602

Updated test with the renamed `net_whitelist` to `net_allowlist`

view details

Colin Harrington

commit sha 620517a69af46f6fd32b261e39467c8c19627a53

linted and formatted resolve_hosts.rs

view details

Colin Harrington

commit sha 59d4c80097912afa69adc44e68b325575ece5106

Formatting changes in flags.rs via ./tools/format.py

view details

push time in a month

PR opened denoland/deno

Added ipv6 parsing for --allow-net cli parameters

Fixes #5518

Rather than implement our own host name parsing, I leveraged the url package that is already used elsewhere in the project.

  • Moved resolve_hosts out of flags.rs following the pattern of resolve_addr
  • Implemented bare port parsing
  • extended tests started by jinliming2

A host could be a host:port combination, an IpAddr or a bare port such as :8080

This PR is my refactoring of https://github.com/denoland/deno/pull/5520 which seems to have stalled out a bit.

+232 -38

0 comment

4 changed files

pr created time in a month

push eventColinHarrington/deno

Colin Harrington

commit sha 12f06bc088cdadd6480c522f6a872006d2eee34b

Formatting changes in flags.rs via ./tools/format.py

view details

push time in a month

PR opened denoland/deno

Update contributing.md for consistency

Updated tools/format.py to ./tools/format.py for consistency with the linting example: ./tools/lint.py

<!-- Before submitting a PR, please read https://github.com/denoland/deno/blob/master/docs/contributing.md -->

+1 -1

0 comment

1 changed file

pr created time in a month

push eventColinHarrington/deno

Colin Harrington

commit sha c58a2c80c5d182ce81980c6ce0c6e3019606478e

Update contributing.md for consistency updated `tools/format.py` to `./tools/format.py` for consistency with the linting example: `./tools/lint.py`

view details

push time in a month

push eventColinHarrington/deno

Nayeem Rahman

commit sha aaa2ed5a6450572d90fdb3fc2f0000759599d46f

fix(std/testing/asserts): Format values in assertArrayContains() (#6060)

view details

Marcos Casagrande

commit sha a1915a0d4fd7d760c234e209967d842f851628d5

fix(fetch): Support 101 status code (#6059)

view details

timonson

commit sha 9a97e61b78fcec4ac9bb3da3e49afd0a2f849b9a

feat(std/encoding): add base64url module (#5976)

view details

Ryan Dahl

commit sha 041ccb6a0d658a7ba393b2cfe86579b2dc4945b7

Remove dead code (#6066)

view details

David Sherret

commit sha 445e44199b3ce4edb4468176a317aafdaae15517

Update to dprint 0.19.1 and swc_ecma_parser 0.24.3 (#6068)

view details

Ryan Dahl

commit sha a90d9fbd348db922c33f45af834bd3b89574b4a9

fix: dynamic import BorrowMutError (#6065)

view details

Ryan Dahl

commit sha aa39dfc62f8fc88ebb3dfb01fbc979f30557ca9a

upgrade: rusty_v8 0.5.0 (#6070)

view details

Ryan Dahl

commit sha 515d19d901e7e5dbc04670807a2bd1cea237e9e8

v1.0.5

view details

Szalay Kristóf

commit sha 4ef38bad4340b5c8100ec2522264c57f0522aa2d

docs: benchmarking (#6075)

view details

Szalay Kristóf

commit sha cab273476a4ff725d53a8e41bf3f8a90060236d4

fix(std/testing/bench): clock assertions without --allow-hrtime (#6069)

view details

Chris Knight

commit sha 1ebd33092779edc630e8f809f72bcef2656b8185

doc: complete unstable documentation and make consistent (#6074)

view details

matheus

commit sha 94bf551ead0ab5dc922cb61d13b3141896d5a8ae

fix(std/http/file_server): args handling only if invoked directly (#5989)

view details

David Sherret

commit sha fcae2fec879caf26ebe7af17b30a3bce6322b85d

Upgrade to swc_ecma_parser 0.24.5 (#6077)

view details

uki00a

commit sha 9bd5c08d5a2a9cdd2649dd24a4d6b26d9af2a4c4

feat(doc): handle detail output for enum (#6078)

view details

Nayeem Rahman

commit sha 97d876f6db55f5f32ac06155dcb4823e1c636215

fix(std/http): Don't use assert() for user input validation (#6092)

view details

Szalay Kristóf

commit sha 42a04ea08a09e29417518524cbe2245c165e6f55

refactor(std/testing/bench): Remove differentiating on runs count (#6084)

view details

Ryan Dahl

commit sha e3cc3db20fc86d9adb19bb472e8c96ae5f7c77c0

Revert "feat: format deno bundle output (#5139)" (#6085) This reverts commit 93cf3bd5341d5985201ea0905280082d5a3310f9.

view details

Jon Short

commit sha 4b1638dccc601ff0282172c7e3ef0f1126a603ed

feat(std/testing): Allow non-void promises in assertThrowsAsync (#6052)

view details

Matt Dumler

commit sha a04166e9fa87450dfa910afeaf0c1dad988f3988

deno doc docs (#5650)

view details

Yusuke Sakurai

commit sha 430beebc46be1dc87a993c2f7442c5c22076f458

doc: Improved ws example and README (#5636)

view details

push time in a month

push eventColinHarrington/deno

Ali Hasani

commit sha eddb916883901385233bea24313e2920fcac5388

Implement Deno.kill for windows (#5347)

view details

Bert Belder

commit sha 36fde75d779078118af3b2b6c078bcbfb47b1a0f

Miscellaneous documentation and spelling improvements (#5527) * Extended/updated documentation on code editor setup and plugins. * Moved documentation to the right file. * Fixed spelling errors in documentation and code. * Updated broken links. Co-authored-by: 迷渡 <justjavac@gmail.com> Co-authored-by: AlfieriChou <alfierichou@gmail.com> Co-authored-by: Anil Seervi <anil13112000@gmail.com Co-authored-by: Bert Belder <bertbelder@gmail.com> Co-authored-by: Fernando Basso <fernandobasso.br@gmail.com> Co-authored-by: József Sallai <jozsef@sallai.me> Co-authored-by: S4ltyGo4t <mario.weidner@gmx.de> Co-authored-by: Tommy May <tommymay37@gmail.com> Co-authored-by: Turbinya <wownucleos@gmail.com> Co-authored-by: ᴜɴвʏтᴇ <i@shangyes.net>

view details

Andrey Trebler

commit sha 2d5abbe909071571def869bfc968f33cd62dbe83

fix(std/hash): SHA1 hash of Uint8Array (#5086)

view details

pontakornth

commit sha ce81064e4c78a5d6213aa19351281c6b86e3e1cb

docs(std): Fix typo (#5582)

view details

Bartek Iwańczuk

commit sha 9d63772fe5bacc8fa1e0a8cbb152a2f107ae268f

refactor: rewrite TS dependency analysis in Rust (#5029) This commit completely overhauls how module analysis is performed in TS compiler by moving the logic to Rust. In the current setup module analysis is performed using "ts.preProcessFile" API in a special TS compiler worker running on a separate thread. "ts.preProcessFile" allowed us to build a lot of functionality in CLI including X-TypeScript-Types header support and @deno-types directive support. Unfortunately at the same time complexity of the ops required to perform supporting tasks exploded and caused some hidden permission escapes. This PR introduces "ModuleGraphLoader" which can parse source and load recursively all dependent source files; as well as declaration files. All dependencies used in TS compiler and now fetched and collected upfront in Rust before spinning up TS compiler. To achieve feature parity with existing APIs this commit includes a lot of changes: * add "ModuleGraphLoader" - can fetch local and remote sources - parses source code using SWC and extracts imports, exports, file references, special headers - this struct inherited all of the hidden complexity and cruft from TS version and requires several follow up PRs * rewrite cli/tsc.rs to perform module analysis upfront and send all required source code to TS worker in one message * remove op_resolve_modules and op_fetch_source_files from cli/ops/compiler.rs * run TS worker on the same thread

view details

Matt Dumler

commit sha 7863d611fcb26b6f2f8a911babb839584668f936

Update `docs/getting_started/permissions.md` (#5574) Aligned the example wording more closely with that in the `first_steps.md` document, and made other minor edits/corrections.

view details

Richard Lemaster

commit sha af09ba005633ef3b7bae8bb511d1e526cb3aa61b

Update style_guide.md (#5576)

view details

Matt Dumler

commit sha b3a216790a64db1e49ce8d977930aacbe6c7178a

Update `docs/getting_started/first_steps.md` (#5573)

view details

Bartek Iwańczuk

commit sha f6caf4883dc507d9aa7f222868f5e7f844d303f3

fix: disable test using 019_media_types (#5589) This commit disabled flaky test in cli/module_graph.rs. The test uses 019_media_types.ts which was known to be flaky for some time. Test should be reenabled once test HTTP server is rewritten to Rust.

view details

Ryan Dahl

commit sha 2a038eafcd1bd715f865e3b4642575af05893dc5

Revert "Fix definition of URL constructor (#5521)" (#5564) This reverts commit 63bc468365bceda929a39b5eb93b605e2dc2bd9c.

view details

Ali Hasani

commit sha c3ec16535f55030ded8d76a82f0e1feaa1c8a3de

Make Deno.remove() work with directory symlinks on windows (#5488)

view details

Nayeem Rahman

commit sha 93c21646739a46a9710be9d580256e18bee740c0

Fix URL encoding (#5557)

view details

Nayeem Rahman

commit sha 76ee5c780848a922dfc0ab8ac48096ab2262cc4a

docs: Clarify external code vendoring (#5597)

view details

Matt Dumler

commit sha 88b24261ba467c20d4ef90224b07c19a71398f0f

adjust docs (#5598)

view details

Ali Hasani

commit sha 6072755eadb7342a409f43260e5a17b956703a1c

Implement Deno.symlink() for windows (#5533)

view details

buckle2000

commit sha 1be7ec47ac3b6e63be2b03245a26e060b8268b5e

Mark Deno.pid and Deno.noColor as const (#5593)

view details

uki00a

commit sha cdc9323cccdee544562712018f722026bdfbbd6c

fix: REPL does not exit properly when close() is called (#5451)

view details

Speykious

commit sha 9752b853ddac3ba41378d0ae8a8604a28e285ffb

Provide better ANSI colorized output when inspecting objects (#5404)

view details

zfx

commit sha 7589d4d7c4a7c95298268eb8bea0e808feb0c6a9

fix(multipart): fix error when parsing file name in utf8 format (#5428)

view details

moumni

commit sha 949061c4b68e41aa93da97125cd15ad8c9e7f44f

fix url (#5637)

view details

push time in a month

Pull request review commenthome-assistant/core

Add Plum Lightpad config flow

     extra=vol.ALLOW_EXTRA, ) +PLATFORMS = ["light"] -async def async_setup(hass, config):++async def async_setup(hass: HomeAssistant, config: dict):     """Plum Lightpad Platform initialization."""+    if DOMAIN not in config:+        return True      conf = config[DOMAIN]-    plum = Plum(conf[CONF_USERNAME], conf[CONF_PASSWORD]) -    hass.data[DOMAIN] = plum+    _LOGGER.info("Found Plum Lightpad configuration in config, importing...")+    hass.async_create_task(+        hass.config_entries.flow.async_init(+            DOMAIN, context={"source": SOURCE_IMPORT}, data=conf+        )+    ) -    def cleanup(event):-        """Clean up resources."""-        plum.cleanup()+    return True -    hass.bus.async_listen_once(EVENT_HOMEASSISTANT_STOP, cleanup) -    cloud_web_sesison = async_get_clientsession(hass, verify_ssl=True)-    await plum.loadCloudData(cloud_web_sesison)--    async def new_load(device):-        """Load light and sensor platforms when LogicalLoad is detected."""-        await asyncio.wait(-            [-                hass.async_create_task(-                    discovery.async_load_platform(-                        hass, "light", DOMAIN, discovered=device, hass_config=conf-                    )-                )-            ]-        )+async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry):+    """Set up Plum Lightpad from a config entry."""+    _LOGGER.debug("Setting up config entry with ID = %s", entry.unique_id) -    async def new_lightpad(device):-        """Load light and binary sensor platforms when Lightpad detected."""-        await asyncio.wait(-            [-                hass.async_create_task(-                    discovery.async_load_platform(-                        hass, "light", DOMAIN, discovered=device, hass_config=conf-                    )-                )-            ]-        )+    username = entry.data.get(CONF_USERNAME)+    password = entry.data.get(CONF_PASSWORD) -    device_web_session = async_get_clientsession(hass, verify_ssl=False)-    hass.async_create_task(-        plum.discover(-            hass.loop,-            loadListener=new_load,-            lightpadListener=new_lightpad,-            websession=device_web_session,+    try:+        plum = await load_plum(username, password, hass)+    except ContentTypeError as ex:+        _LOGGER.error("Unable to authenticate to Plum cloud: %s", ex)+        return False+    except (ConnectTimeout, HTTPError) as ex:+        _LOGGER.error("Unable to connect to Plum cloud: %s", ex)+        raise ConfigEntryNotReady++    hass.data.setdefault(DOMAIN, {})+    hass.data[DOMAIN][entry.entry_id] = plum++    for component in PLATFORMS:+        hass.async_create_task(+            hass.config_entries.async_forward_entry_setup(entry, component)         )-    ) +    def cleanup(event):+        """Clean up resources."""+        plum.cleanup()++    hass.bus.async_listen_once(EVENT_HOMEASSISTANT_STOP, cleanup)

I still think this bock should be moved after the discovery task in light.py

prystupa

comment created time in a month

Pull request review commenthome-assistant/core

Add Plum Lightpad config flow

+"""Reusable utilities for the Plum Lightpad component."""++from plumlightpad import Plum++from homeassistant.core import HomeAssistant+from homeassistant.helpers.aiohttp_client import async_get_clientsession+++async def load_plum(username: str, password: str, hass: HomeAssistant) -> Plum:

I like putting this code into it's own utility of some kind. Can we add a test here?

prystupa

comment created time in a month

Pull request review commenthome-assistant/core

Add Plum Lightpad config flow

     extra=vol.ALLOW_EXTRA, ) +PLATFORMS = ["light"] -async def async_setup(hass, config):++async def async_setup(hass: HomeAssistant, config: dict):     """Plum Lightpad Platform initialization."""+    if DOMAIN not in config:+        return True      conf = config[DOMAIN]-    plum = Plum(conf[CONF_USERNAME], conf[CONF_PASSWORD]) -    hass.data[DOMAIN] = plum+    _LOGGER.info("Found Plum Lightpad configuration in config, importing...")+    hass.async_create_task(+        hass.config_entries.flow.async_init(+            DOMAIN, context={"source": SOURCE_IMPORT}, data=conf+        )+    ) -    def cleanup(event):-        """Clean up resources."""-        plum.cleanup()+    return True -    hass.bus.async_listen_once(EVENT_HOMEASSISTANT_STOP, cleanup) -    cloud_web_sesison = async_get_clientsession(hass, verify_ssl=True)-    await plum.loadCloudData(cloud_web_sesison)+async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry):+    """Set up Plum Lightpad from a config entry."""+    _LOGGER.debug("Setting up config entry with ID = %s", entry.unique_id) -    async def new_load(device):-        """Load light and sensor platforms when LogicalLoad is detected."""-        await asyncio.wait(-            [-                hass.async_create_task(-                    discovery.async_load_platform(-                        hass, "light", DOMAIN, discovered=device, hass_config=conf-                    )-                )-            ]-        )+    username = entry.data.get(CONF_USERNAME)+    password = entry.data.get(CONF_PASSWORD) -    async def new_lightpad(device):-        """Load light and binary sensor platforms when Lightpad detected."""-        await asyncio.wait(-            [-                hass.async_create_task(-                    discovery.async_load_platform(-                        hass, "light", DOMAIN, discovered=device, hass_config=conf-                    )-                )-            ]-        )+    try:+        plum = await load_plum(username, password, hass) -    device_web_session = async_get_clientsession(hass, verify_ssl=False)-    hass.async_create_task(-        plum.discover(-            hass.loop,-            loadListener=new_load,-            lightpadListener=new_lightpad,-            websession=device_web_session,-        )-    )+        hass.data.setdefault(DOMAIN, {})+        hass.data[DOMAIN][entry.entry_id] = plum -    return True+        for component in PLATFORMS:+            hass.async_create_task(+                hass.config_entries.async_forward_entry_setup(entry, component)+            )++        def cleanup(event):+            """Clean up resources."""+            plum.cleanup()++        hass.bus.async_listen_once(EVENT_HOMEASSISTANT_STOP, cleanup)+        return True++    except (ContentTypeError, ConnectTimeout, HTTPError) as ex:

Can we write a test for these errors?

prystupa

comment created time in a month

Pull request review commenthome-assistant/core

Add Plum Lightpad config flow

 """Support for Plum Lightpad lights."""+import logging+from typing import Callable, List++from plumlightpad import Plum+ from homeassistant.components.light import (     ATTR_BRIGHTNESS,     ATTR_HS_COLOR,     SUPPORT_BRIGHTNESS,     SUPPORT_COLOR,     LightEntity, )+from homeassistant.config_entries import ConfigEntry+from homeassistant.core import HomeAssistant+from homeassistant.helpers.aiohttp_client import async_get_clientsession+from homeassistant.helpers.entity import Entity import homeassistant.util.color as color_util  from .const import DOMAIN +_LOGGER = logging.getLogger(__name__)+++async def async_setup_entry(+    hass: HomeAssistant,+    entry: ConfigEntry,+    async_add_entities: Callable[[List[Entity]], None],+) -> None:+    """Set up Plum Lightpad dimmer lights and glow rings."""++    plum: Plum = hass.data[DOMAIN][entry.entry_id] -async def async_setup_platform(hass, config, async_add_entities, discovery_info=None):-    """Initialize the Plum Lightpad Light and GlowRing."""-    if discovery_info is None:-        return+    def setup_entities(device) -> None:+        entities = [] -    plum = hass.data[DOMAIN]+        if "lpid" in device:+            lightpad = plum.get_lightpad(device["lpid"])+            entities.append(GlowRing(lightpad=lightpad)) -    entities = []+        if "llid" in device:+            logical_load = plum.get_load(device["llid"])+            entities.append(PlumLight(load=logical_load)) -    if "lpid" in discovery_info:-        lightpad = plum.get_lightpad(discovery_info["lpid"])-        entities.append(GlowRing(lightpad=lightpad))+        if entities:+            async_add_entities(entities) -    if "llid" in discovery_info:-        logical_load = plum.get_load(discovery_info["llid"])-        entities.append(PlumLight(load=logical_load))+    async def new_load(device):+        setup_entities(device) -    if entities:-        async_add_entities(entities)+    async def new_lightpad(device):+        setup_entities(device)++    device_web_session = async_get_clientsession(hass, verify_ssl=False)+    hass.loop.create_task(+        plum.discover(+            hass.loop,+            loadListener=new_load,+            lightpadListener=new_lightpad,+            websession=device_web_session,+        )+    )

I think the cleanup function from the config flow should be here. There is no need to cleanup until the actual devices are 'discovered' or hooked up.

prystupa

comment created time in a month

Pull request review commenthome-assistant/core

Add Plum Lightpad config flow

 homeassistant/components/plaato/* @JohNan homeassistant/components/plant/* @ChristianKuehnel homeassistant/components/plex/* @jjlawren homeassistant/components/plugwise/* @CoMPaTech @bouwew-homeassistant/components/plum_lightpad/* @ColinHarrington+homeassistant/components/plum_lightpad/* @ColinHarrington @prystupa

@prystupa Did you actually want to be a codeowner for this platform? I definitely appreciate the help and you are contributing to adding config-flow to this platform, but are you signing up to be a codeowner of this integration?

prystupa

comment created time in a month

Pull request review commenthome-assistant/core

Add Plum Lightpad config flow

 """Support for Plum Lightpad lights."""+import logging+from typing import Callable, List++from plumlightpad import Plum+ from homeassistant.components.light import (     ATTR_BRIGHTNESS,     ATTR_HS_COLOR,     SUPPORT_BRIGHTNESS,     SUPPORT_COLOR,     LightEntity, )+from homeassistant.config_entries import ConfigEntry+from homeassistant.core import HomeAssistant+from homeassistant.helpers.aiohttp_client import async_get_clientsession+from homeassistant.helpers.entity import Entity import homeassistant.util.color as color_util  from .const import DOMAIN +_LOGGER = logging.getLogger(__name__)+++async def async_setup_entry(+    hass: HomeAssistant,+    entry: ConfigEntry,+    async_add_entities: Callable[[List[Entity]], None],+) -> None:+    """Set up Plum Lightpad dimmer lights and glow rings."""++    plum: Plum = hass.data[DOMAIN][entry.entry_id] -async def async_setup_platform(hass, config, async_add_entities, discovery_info=None):-    """Initialize the Plum Lightpad Light and GlowRing."""-    if discovery_info is None:-        return+    def setup_entities(device) -> None:+        entities = [] -    plum = hass.data[DOMAIN]+        if "lpid" in device:+            lightpad = plum.get_lightpad(device["lpid"])+            entities.append(GlowRing(lightpad=lightpad)) -    entities = []+        if "llid" in device:+            logical_load = plum.get_load(device["llid"])+            entities.append(PlumLight(load=logical_load)) -    if "lpid" in discovery_info:-        lightpad = plum.get_lightpad(discovery_info["lpid"])-        entities.append(GlowRing(lightpad=lightpad))+        if entities:+            async_add_entities(entities) -    if "llid" in discovery_info:-        logical_load = plum.get_load(discovery_info["llid"])-        entities.append(PlumLight(load=logical_load))+    async def new_load(device):+        setup_entities(device) -    if entities:-        async_add_entities(entities)+    async def new_lightpad(device):+        setup_entities(device)++    device_web_session = async_get_clientsession(hass, verify_ssl=False)+    hass.async_create_task(

Calling plum.cleanup() isn't right here, but hooking up the Home assistant shutdown hook (that calls plum.cleanup() when home assistant is shutting down is. Check your own cleanup function

prystupa

comment created time in 2 months

create barnchColinHarrington/home-assistant.io

branch : plum-config-flow

created branch time in 2 months

pull request commenthome-assistant/core

Add config flow to plum_lightpad

FYI, I pushed up what I have here: https://github.com/ColinHarrington/home-assistant.io/tree/plum-config-flow

galak

comment created time in 2 months

Pull request review commenthome-assistant/core

Add Plum Lightpad config flow

 """Support for Plum Lightpad lights."""+import logging+from typing import Callable, List++from plumlightpad import Plum+ from homeassistant.components.light import (     ATTR_BRIGHTNESS,     ATTR_HS_COLOR,     SUPPORT_BRIGHTNESS,     SUPPORT_COLOR,     LightEntity, )+from homeassistant.config_entries import ConfigEntry+from homeassistant.core import HomeAssistant+from homeassistant.helpers.aiohttp_client import async_get_clientsession+from homeassistant.helpers.entity import Entity import homeassistant.util.color as color_util  from .const import DOMAIN +_LOGGER = logging.getLogger(__name__)+++async def async_setup_entry(+    hass: HomeAssistant,+    entry: ConfigEntry,+    async_add_entities: Callable[[List[Entity]], None],+) -> None:+    """Set up Plum Lightpad dimmer lights and glow rings."""++    plum: Plum = hass.data[DOMAIN][entry.entry_id] -async def async_setup_platform(hass, config, async_add_entities, discovery_info=None):-    """Initialize the Plum Lightpad Light and GlowRing."""-    if discovery_info is None:-        return+    def setup_entities(device) -> None:+        entities = [] -    plum = hass.data[DOMAIN]+        if "lpid" in device:+            lightpad = plum.get_lightpad(device["lpid"])+            entities.append(GlowRing(lightpad=lightpad)) -    entities = []+        if "llid" in device:+            logical_load = plum.get_load(device["llid"])+            entities.append(PlumLight(load=logical_load)) -    if "lpid" in discovery_info:-        lightpad = plum.get_lightpad(discovery_info["lpid"])-        entities.append(GlowRing(lightpad=lightpad))+        if entities:+            async_add_entities(entities) -    if "llid" in discovery_info:-        logical_load = plum.get_load(discovery_info["llid"])-        entities.append(PlumLight(load=logical_load))+    async def new_load(device):+        setup_entities(device) -    if entities:-        async_add_entities(entities)+    async def new_lightpad(device):+        setup_entities(device)++    device_web_session = async_get_clientsession(hass, verify_ssl=False)+    hass.async_create_task(

I think the cleanup/shutdown hook should be at the end of this function.

prystupa

comment created time in 2 months

Pull request review commenthome-assistant/core

Add Plum Lightpad config flow

+"""Config flow for Plum Lightpad."""+import logging+from typing import Any, Dict, Optional++import voluptuous as vol++from homeassistant import config_entries+from homeassistant.const import CONF_PASSWORD, CONF_USERNAME+from homeassistant.helpers import ConfigType++from .const import DOMAIN+from .utils import load_plum++_LOGGER = logging.getLogger(__name__)+++class PlumLightpadConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):+    """Config flow for Plum Lightpad integration."""++    VERSION = 1++    async def async_step_user(self, user_input: Optional[ConfigType]) -> Dict[str, Any]:+        """Handle a flow initialized by the user or redirected to by import."""+        if not user_input:+            return self.async_show_form(+                step_id="user",+                data_schema=vol.Schema(+                    {+                        vol.Required(CONF_USERNAME): str,+                        vol.Required(CONF_PASSWORD): str,+                    }+                ),+            )++        username = user_input[CONF_USERNAME]+        password = user_input[CONF_PASSWORD]++        # load Plum just so we know username/password work+        plum = await load_plum(username, password, self.hass)+        plum.cleanup()

Calling plum.cleanup() here isn't necessary here.

prystupa

comment created time in 2 months

Pull request review commenthome-assistant/core

Add Plum Lightpad config flow

 def name(self):         """Return the name of the switch if any."""         return self._load.name +    @property+    def device_info(self):+        """Return the device info."""+        return {+            "name": self.name,+            "identifiers": {(DOMAIN, self.unique_id)},+            "model": "Dimmer",+            "manufacturer": "Plum",+        }+     @property     def brightness(self) -> int:

Yeah, I'm OK with it for now. I don't have a better name at the moment, so leave it for now

prystupa

comment created time in 2 months

Pull request review commenthome-assistant/core

Add Plum Lightpad config flow

 def name(self):         """Return the name of the switch if any."""         return self._load.name +    @property+    def device_info(self):+        """Return the device info."""+        return {+            "name": self.name,+            "identifiers": {(DOMAIN, self.unique_id)},+            "model": "Dimmer",+            "manufacturer": "Plum",+        }+     @property     def brightness(self) -> int:

Yeah, I'm OK with it for now. I don't have a better name at the moment, so leave it for now

prystupa

comment created time in 2 months

Pull request review commenthome-assistant/core

Add Plum Lightpad config flow

 def name(self):         """Return the name of the switch if any."""         return self._load.name +    @property+    def device_info(self):+        """Return the device info."""+        return {+            "name": self.name,+            "identifiers": {(DOMAIN, self.unique_id)},+            "model": "Dimmer",+            "manufacturer": "Plum",+        }+     @property     def brightness(self) -> int:

The load is physically attached to one of the lightpad dimmer switches - but there can be multiple lightpads associated with a LogicalLoad. Something about calling the model "Dimmer" here doesn't sit well.

prystupa

comment created time in 2 months

Pull request review commenthome-assistant/core

Add Plum Lightpad config flow

+"""Config flow for Plum Lightpad."""+import logging+from typing import Any, Dict, Optional++import voluptuous as vol++from homeassistant import config_entries+from homeassistant.const import CONF_PASSWORD, CONF_USERNAME+from homeassistant.helpers import ConfigType++from .const import DOMAIN+from .utils import load_plum++_LOGGER = logging.getLogger(__name__)+++class PlumLightpadConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):+    """Config flow for Plum Lightpad integration."""++    VERSION = 1++    async def async_step_user(self, user_input: Optional[ConfigType]) -> Dict[str, Any]:+        """Handle a flow initialized by the user or redirected to by import."""+        if not user_input:+            return self.async_show_form(+                step_id="user",+                data_schema=vol.Schema(+                    {+                        vol.Required(CONF_USERNAME): str,+                        vol.Required(CONF_PASSWORD): str,+                    }+                ),+            )++        username = user_input[CONF_USERNAME]+        password = user_input[CONF_PASSWORD]++        # load Plum just so we know username/password work+        plum = await load_plum(username, password, self.hass)+        plum.cleanup()

cleanup is used for shutting down and disconnecting the TCP listener from the actual devices. Why put it here?

prystupa

comment created time in 2 months

Pull request review commenthome-assistant/core

Add Plum Lightpad config flow

 def name(self):         """Return the name of the switch if any."""         return self._load.name +    @property+    def device_info(self):+        """Return the device info."""+        return {+            "name": self.name,+            "identifiers": {(DOMAIN, self.unique_id)},

I think the llid or Logical Load ID might be a better choice here - they are big long GUIDs.

prystupa

comment created time in 2 months

Pull request review commenthome-assistant/core

Add Plum Lightpad config flow

 def name(self):         """Return the name of the switch if any."""         return self._name +    @property+    def device_info(self):+        """Return the device info."""+        return {+            "name": self.name,+            "identifiers": {(DOMAIN, self.unique_id)},

Each Lightpad has a glow ring. What exactly is self_unique_id supposed to be? Maybe using the LightPad ID (lpid) in making the identifier?

prystupa

comment created time in 2 months

PublicEvent

pull request commentdenoland/deno

feat: cli allow-net support ipv6

I took a stab at rewriting that resolve_hosts function because I was interested and this is what I came up with: https://github.com/ColinHarrington/deno/blob/ipv6-hosts/cli/resolve_hosts.rs#L27-L44

jinliming2

comment created time in 2 months

create barnchColinHarrington/deno

branch : ipv6-hosts

created branch time in 2 months

pull request commenthome-assistant/core

Add config flow to plum_lightpad

I was able to get config flow working without changing the 1:1 structure of the Lightpads & loads. Basically leaving cloud initialization in config_flow.py and allowing local discovery to still happen when setting up the platform. It still needs a bit of cleanup and testing.

galak

comment created time in 2 months

pull request commenthome-assistant/core

Add config flow to plum_lightpad

HomeAssistant has added the concept of "Devices" since I originally wrote this integration. I think that we'll want to restructure the integration a little bit to normalize these lightpad devices and their associated entities. I think we should leave the existing device structures in place while adding the config flow.

galak

comment created time in 2 months

pull request commenthome-assistant/core

Add config flow to plum_lightpad

I worry about cloud support going away some day

I share that concern. The devices need an access token or they deny requests. I think it may be just the same basic auth creds that the cloud API uses. There are two components here: a) the cloud sync and b) the local network discovery which finishes initializing the devices. (really this could be two parts, the actual discovery (intentionally soliciting) and then the devices emit a UDP packet every 5 minutes to let you know that they are still there and available, or if another one connects to the network.

Do you happen to have a small sample app using the python lib?

No, that's an area that could be improved too. There is an unreleased version with some minor fixes that hasn't gone out yet, and that lib could be cleaned up, tested and have examples in place. We can reshape the lib if needed - feel free to PR that repo too!

Let me see what I can do to take what you've done here without the 1:1 restructuring

galak

comment created time in 2 months

pull request commenthome-assistant/core

Add config flow to plum_lightpad

Sweet! Migrating to config flow is something that I had wanted to do, but hadn't had the time to take a stab at yet.

I'm not sure I like the lightpads 1:1 with the logical loads. In a 3-way configuration, there are actually two lightpads on the network even though only one of them is directly connected to the load. My original PR had support for Power monitoring and the motion sensors, I'd like to have that exposed in HA too, and that'll require Multiple lightpads in that 3-way configuration. Like you said the 1:1 has issues.

I'll take a closer look at the PR and see what I find.

galak

comment created time in 2 months

CommitCommentEvent

Pull request review commentdenoland/deno

feat: cli allow-net support ipv6

 fn resolve_hosts(paths: Vec<String>) -> Vec<String> {     let parts = host_and_port.split(':').collect::<Vec<&str>>();

I think this is more of the issue, naively splitting on :

Looks like resolve_hosts could be updated to support bracketed based host names (https://tools.ietf.org/html/rfc2732.html) (and then parsing IP based hostnames?)

jinliming2

comment created time in 3 months

Pull request review commentdenoland/deno

feat: cli allow-net support ipv6

+// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.+use regex::Regex;++/// Check IPv4 address+pub fn is_ipv4(ip_addr: &str) -> bool {+  lazy_static! {+    static ref RE: Regex = Regex::new(+      format!(+        r"^(?:{ipv4_part}\.){{3}}{ipv4_part}$",+        ipv4_part = "(?:[0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])"+      )+      .as_ref()+    )+    .unwrap();+  }++  if ip_addr.is_empty() {+    return false;+  }++  RE.is_match(ip_addr)+}++/// Check IPv6 address+pub fn is_ipv6(ip_addr: &str) -> bool {

I don't think deno should maintain this type of regex for matching IPs. I think we could get most of this by using the implementation baked into rust: std::net::IpAddr

let ip: IpAddr = "::1".parse();

jinliming2

comment created time in 3 months

Pull request review commentdenoland/deno

Errors in benchmarks should fail CI

 exec_time_benchmarks = [     ("hello", ["run", "cli/tests/002_hello.ts"]),     ("relative_import", ["run", "cli/tests/003_relative_import.ts"]),-    ("error_001", ["run", "cli/tests/error_001.ts"]),+    ("error_001", ["run", "cli/tests/error_001.ts", "|| true"]),

@ry I updated the PR with your feedback. Let me know what you think

ColinHarrington

comment created time in 3 months

issue commentdenoland/deno

discussion: Permissions for Deno Worker

I think that the permissions & whitelist relationship should be treated as a unit. Instead of breaking the read permissions into read and readWhitelist I'd rather see it defined as a complex type as @lucacasonato described:

permissions: {
  read?: boolean | string[] | "inherit";
  write?:  boolean | string[] | "inherit";
  net?: boolean | string[] | "inherit";
  env?: boolean | "inherit";
  hrtime?: boolean | "inherit";
  run?: boolean | "inherit";
}

That definition is more in line with the parsing on command line flags like --allow-read

bartlomieju

comment created time in 3 months

issue commentdenoland/deno

discussion: Permissions for Deno Worker

should permissions be inherited?

Inheriting permissions from the parent is an acceptable default when no permissions are supplied (as @bartlomieju described in his example):

new Worker("./worker.ts", {
  type: "module",
  deno: {}
});

As soon as you start defining worker permissions, then I'd say that you have to fill out the permissions that the worker requires and deny any that are not specified.

new Worker("./worker.ts", {
  type: "module",
  deno: { 
    permissions: { 
      read: true,
      write: true,
      net: "inherit"
    } 
  }
});
bartlomieju

comment created time in 3 months

push eventColinHarrington/deno

Juan Julián Merelo Guervós

commit sha f2e431c2b07135c0deab442a60f267324882d0b8

shorten example (#5448)

view details

Anil Seervi

commit sha 3e07e0b01d91a5ea428719ca99bc732c0ee1be94

Fix typos (#5441)

view details

Chris Knight

commit sha 8c45d3a06d90bd0ab13d38b6a1f892f67e80f78e

doc: add stream api (#5418)

view details

skdltmxn

commit sha 06f3268f3af12bdd217092185b1967ebf6b14632

feat: add std/hash/fnv (#5403)

view details

Stéphane Klein

commit sha 62a7fcbdc40479b7fdae98eeaedab1efc7b95d4a

fix(std/testing): Provide message and diff for assertStrictEq (#5417) closes #5416

view details

Marcos Casagrande

commit sha ce57a1824d3c89d19460efb315b273a43d18373e

feat(std/node): fs.writeFileSync polyfill (#5414)

view details

Tomasz Gałkowski

commit sha 8440d765d51c0886f45843ad217a6a5dbabd5049

fix: setTimeout and friends have too strict types (#5412)

view details

Claudio Cicali

commit sha f37967d229a8523251b3ab8b77e09c87914717d5

fix link (#5333) Replaced with the current master version

view details

Kerollos Magdy

commit sha b0d62cdbd79a8dfcbe9ef8539fe2efae3f21890b

Add link to JSDoc website (#5370)

view details

uki00a

commit sha c5a54e44bc0a697b45efb98d3f5d1dc751efe49f

chore: port deno_dir_test to Rust (#5408)

view details

Max

commit sha d4afc9890dfa60a233167e2ea003d9e7c830ee61

adjust example code (#5332)

view details

Bartek Iwańczuk

commit sha 89fe81168e75a375a67e9d391b367d2a9749153c

fix: panic if $DENO_DIR is a relative path (#5375) This commit fixes panic occurring if $DENO_DIR is set to a relative path, eg. "DENO_DIR=denodir deno run main.ts". Before creating DenoDir instance given path is checked and if necessary resolved against current working directory. Additional sanity checks were put in place to ensure all caches receive absolute path for the location.

view details

Linus Unnebäck

commit sha 8228ea85fd610d5496a3240538f15d2f4eed1d87

refactor(fs): use every instead of reduce (#5323) The previous usage of `reduce` was basically implementing the `every` A small difference is that the new implementation will stop checking as soon as one element have returned false, which will reduce the number of unnecessary checks.

view details

Yiyu Lin

commit sha 871a0c9c0ea72aa95eb83e2e9010bdc05403f7d4

fix some clippy warning (#5462)

view details

Peter Indiola

commit sha 0e4a927bcf8fd2f7f5424007ba8778dd296a7bbd

docs(std/fmt): Fix typo (#5315)

view details

Henry Zhuang

commit sha e98b7594466b1cc3e7b328dda08a7326d211767c

improve deferred test (#5459)

view details

ddaza

commit sha 15466c9007df170493aafd3080b055f91fb54b05

improve chat example (#5474)

view details

Andrius Kripaitis

commit sha a9ebbca170fa0e0cf33df6ee7580f686acdf5bf2

Fix JavaScript spelling (#5467)

view details

Dan Vanderkam

commit sha aa1284ceb0f46516d04a6e29862cfc0848a6146c

Lets --> Let's (#5473)

view details

Bert Belder

commit sha 76a6a1ff46adde01877fbf4b874dc8d344a74f9c

Fix a bunch of spelling errors (#5314)

view details

push time in 3 months

push eventColinHarrington/deno

Colin Harrington

commit sha 72d5d87a6a2e916efb314d79eddedd16b99933db

Used 'return code' instead of 'exit code'

view details

push time in 3 months

push eventColinHarrington/deno

Colin Harrington

commit sha e559770c736653906b9bcb31248bd9e7b19c0097

Used 'return code' instead of exit code

view details

push time in 3 months

Pull request review commentdenoland/deno

Errors in benchmarks should fail CI

 exec_time_benchmarks = [     ("hello", ["run", "cli/tests/002_hello.ts"]),     ("relative_import", ["run", "cli/tests/003_relative_import.ts"]),-    ("error_001", ["run", "cli/tests/error_001.ts"]),+    ("error_001", ["run", "cli/tests/error_001.ts", "|| true"]),

I agree with you. Adding || true to the arguments isn't exactly what we need.

I updated the PR and to include an optional expected return code to the benchmark scenarios. You can specify the expected Error code or None to retain the default behavior.

hyperfine takes a list of commands to benchmark. When we remove the --ignore-failure flag, it will exit as soon as it encounters an error so we'll need some mechanism to capture at failure. Appending || true would give just swallow any errors. I added ; test $? -eq 1 which tests that the last return code ($?) is equal to the expected return/exit code.

ColinHarrington

comment created time in 3 months

push eventColinHarrington/deno

Colin Harrington

commit sha 916906d5b4a1fe8b84efdadbb68db6dec236b9bc

#4187 Added optional exit-code verification to benchmark scenarios.

view details

push time in 3 months

push eventColinHarrington/deno

Colin Harrington

commit sha 8db81fe17026cec363041ac4770c7a3480efdf2a

#4187 Fixed benchmark.py formatting

view details

push time in 3 months

PR opened denoland/deno

Errors in benchmarks should fail CI

As described in #4187 the benchmarks should not be concealing actual errors.

  • Removed the --ignore-failure flag sent to hyperfine
  • Added error suppression to the error_001 test case
  • Fixed a typescript compilation error present in cli/tests/workers_round_robin_bench.ts
+3 -3

0 comment

2 changed files

pr created time in 3 months

create barnchColinHarrington/deno

branch : benchmark-ignoring-errors

created branch time in 3 months

fork ColinHarrington/deno

A secure JavaScript and TypeScript runtime

https://deno.land/

fork in 3 months

issue commentdenoland/deno

Replace sys-info crate dependency with systemstat

Looks like @ry is reconsidering systemstat lacking hostname and release parsing functionality, dependency issues among others. It's not a 1:1 replacement. Should the good first issue label be removed?

ry

comment created time in 3 months

more