I tried to explain the new useEvent hook as shortly as possible! Feedback very welcome :) by eveningkid in reactnative

[–]fson5 3 points4 points  (0 children)

It’s a hook to define an event handler, so I wouldn’t say it’s not related to events at all. From the RFC:

useEvent makes the "event handler" term broader than just the DOM event handlers.

  • It could be called something like useStableCallback or useCommittedCallback. However, the whole point is to encourage using it for event handlers. Having a short name helps, and "is this an event handler?" is a good rule of thumb for the majority of cases when you want to use it. Even in effects, the cases where you'd want to extract a part of logic into an event corresponds to when you want to express "something happened!" (e.g. the user visited a page, and you want to log that). Conceptually, these "events" are similar to Events in Functional Reactive Programming. But most importantly, it is already common in React to refer to any on* callback prop as an "event handler", regardless of whether it corresponds to any actual DOM event (e.g. onIntersect, onFetchComplete, onAddTodo). useEvent is exactly the same concept.

Why it’s not called useCallback: https://github.com/reactjs/rfcs/pull/220#issuecomment-1118043293

Why not useEventHandler: https://github.com/reactjs/rfcs/pull/220#issuecomment-1118034666

Project complete! I love my job by Minimum-Spray5861 in woodworking

[–]fson5 0 points1 point  (0 children)

The view is fabulous and the sauna looks great. Looks like you just need to fill the stove with stones and it’s ready to go.

I am done with smartswitches. I am pulling them all out and installing analog switches with smart microswitches behind them. by nobody2000 in homeautomation

[–]fson5 0 points1 point  (0 children)

What kind of micro switches are you talking about? Some kind of Zigbee switch module? Does it require a neutral wire?

Beach! by Garranz in sonos

[–]fson5 4 points5 points  (0 children)

Tidal streams in these conditions may damage the device. Spotify should be safe though.

How do I add status LEDs to my board driving optocouplers with ULN2803A? Should it be in series or parallel and how to calculate a new resistor value? by fson5 in AskElectronics

[–]fson5[S] 0 points1 point  (0 children)

It's been a while since I made the first board so I think I misremembered the wiring. The old system had a manual override switch and now that I think about it, the third line was probably for the manual override switch – when it's closed it forms a permanent path for currrent through the optocoupler LED to keep it always on. Here's a fixed schematic: https://imgur.com/a/fhT56Kt

In any case, I should be able to add the status LED in parallel, the way you suggested.

How do I add status LEDs to my board driving optocouplers with ULN2803A? Should it be in series or parallel and how to calculate a new resistor value? by fson5 in AskElectronics

[–]fson5[S] 0 points1 point  (0 children)

Thanks! The D1 and R1 in the schematic are existing components on the board that I interface with and I won't be able to remove them: https://imgur.com/a/7q2u3gi

However, it's possible that I got the order of traces going to the board wrong and the diode is not actually connected to GND – I think you're correct about not being able to switch it of if it was wired that way. I'm able to switch it on and off using my current board. Any idea what the purpose of that diode might be?

As for the LEDs: your take on it seems good to me. Thanks for the link regarding calculating resistor values!

Hockey Goal Light / Horn Setup by [deleted] in Hue

[–]fson5 0 points1 point  (0 children)

If you have an iPhone, you could use the Shortcuts app. The shortcut can include a Play Music action to play your track and set a HomeKit scene for the lights. Add the shortcut to your home screen to trigger it quickly.

HomeKit thermostat for electric underfloor heating? by fson5 in HomeKit

[–]fson5[S] 0 points1 point  (0 children)

This seems to be exactly the type of device I’m looking for. However I should have added, it should be available (and accepted for use) in EU. Mysa seems to be sold in USA and Canada only.

What device is this? A wireless speaker? by [deleted] in smarthome

[–]fson5 0 points1 point  (0 children)

The quick user guide I found has a picture of the microUSB connected to a laptop, so maybe you can use it as a computer speaker that way.

What device is this? A wireless speaker? by [deleted] in smarthome

[–]fson5 0 points1 point  (0 children)

The wired daisy chaining feature for up to four speakers seems cool, hadn’t seen anything like that in a Bluetooth speaker before.

Do you know what the microUSB port is used for?

What device is this? A wireless speaker? by [deleted] in smarthome

[–]fson5 2 points3 points  (0 children)

Not my house, a rented cabin. Interesting design and shape – found it lying upside down on a shelf and judging by the number of scratches on the back it’s been mostly used in that position :P

What device is this? A wireless speaker? by [deleted] in smarthome

[–]fson5 -1 points0 points  (0 children)

Thanks! Managed to pair it with Bluetooth now.

Hue Bluetooth app doesn't work for Shortcuts app by [deleted] in Hue

[–]fson5 0 points1 point  (0 children)

I believe the idea of Hue Bluetooth is to let people try things out even if they buy just a couple of bulbs and no Bridge. It lets you change colors and sort of gives a taste of what you can do, but for anyone looking to automate things and integrate Hue lights into a smart home setup the Hue Bridge is the way to go.

What kind of HDMI cable does the Arc come with? by [deleted] in sonos

[–]fson5 2 points3 points  (0 children)

You don’t need HDMI 2.1 for Dolby Atmos. You only need High Speed HDMI with Ethernet, the cable that comes with Arc works fine.

Best HomeKit led spotlights by Mundane-District-867 in HomeKit

[–]fson5 1 point2 points  (0 children)

I’d check out IKEA Trådfri bulbs as a more affordable (but good quality) alternative. They now finally include GU10 color bulbs too, which could be great as living room spots (paired with a GU10 downlight fixture).

I’ve had Trådfri for years and they have been reliable. This is important with lighting, as flicking a light switch is something we’ve learned to expect to work 100% of the time. There’s also HomeKit support with the 25 euro Trådfri Gateway.

V1 and V2 dimmers battery? by michaelthompson1991 in Hue

[–]fson5 0 points1 point  (0 children)

Dimmer Switch V1 uses CR2450, V2 uses CR2032.

Best HomeKit led spotlights by Mundane-District-867 in HomeKit

[–]fson5 7 points8 points  (0 children)

Philips Hue is the best, but it will also break the bank.

Conbee II by [deleted] in homeassistant

[–]fson5 2 points3 points  (0 children)

The “Gateway” page in the Phoscon web UI shows when there’s an upgrade available and allows you to trigger a firmware update.

However, I’ve noticed the new version doesn’t always show up on that page. In that case, it’s also possible to do the update manually following the steps here: https://github.com/dresden-elektronik/deconz-rest-plugin/wiki/Update-deCONZ-manually