You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
One more little feature 😄 This one isn't really that important, feel free to reject the PR if you don't think it's necessary for this program. I'm just hooking up the Identify feature of the base stations to a button in the menu.
I'm reusing WritePowerCharacteristicAsync for this, which isn't quite accurate since Identify isn't a power characteristic. And the log messages issued by WritePowerCharacteristicAsync say "power characteristic" too. If you wanted to make it more accurate, you could just remove the word "Power" from that function.
I only supported V2 base stations. I think V1 base stations also have an Identify feature, but I couldn't find documentation for how to invoke it, and I don't have any to test with. So I just marked it as unsupported for V1.
One additional thing I could do is to set the Visibility to hidden for the Identify button on V1 base stations (that could also be done for the Standby button!). But when I tried to Bind visibility to the version of the lighthouse like this:
it didn't have any effect. I put a break point on the property and it seems it was never being read. I also tried making a SupportsIdentify property in the LighthouseControl code-behind and Bind to that instead, and that time the code gets executed, but it gets executed before LighthouseObject is set, and never gets re-executed once LighthouseObject is set, so the visibility binding gets the wrong value. I'm sure there's a way to get it to refresh, but I didn't investigate further, since I'm not sure if you even want this feature in the program at all!
When binding a property in WPF, its changes should be notified by events or observable attribute.
Probably you need to add the property to LighthouseObject class then bind it.
And the visibility is not boolean, so you need to use Converter={StaticResource BooleanToVisibilityConverter} (see the button for EditIdCommand).
I can merge this as is, though do you continue to work?
When binding a property in WPF, its changes should be notified by events or observable attribute.
Probably you need to add the property to LighthouseObject class then bind it.
And the visibility is not boolean, so you need to use Converter={StaticResource BooleanToVisibilityConverter} (see the button for EditIdCommand).
Ah, thank you!
I can merge this as is, though do you continue to work?
Yeah that's fine! Sorry for the delayed response -- was super busy and forgot 😅
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
One more little feature 😄 This one isn't really that important, feel free to reject the PR if you don't think it's necessary for this program. I'm just hooking up the Identify feature of the base stations to a button in the menu.
I'm reusing
WritePowerCharacteristicAsyncfor this, which isn't quite accurate since Identify isn't a power characteristic. And the log messages issued byWritePowerCharacteristicAsyncsay "power characteristic" too. If you wanted to make it more accurate, you could just remove the word "Power" from that function.I only supported V2 base stations. I think V1 base stations also have an Identify feature, but I couldn't find documentation for how to invoke it, and I don't have any to test with. So I just marked it as unsupported for V1.
One additional thing I could do is to set the Visibility to hidden for the Identify button on V1 base stations (that could also be done for the Standby button!). But when I tried to Bind visibility to the version of the lighthouse like this:
it didn't have any effect. I put a break point on the property and it seems it was never being read. I also tried making a
SupportsIdentifyproperty in theLighthouseControlcode-behind and Bind to that instead, and that time the code gets executed, but it gets executed beforeLighthouseObjectis set, and never gets re-executed onceLighthouseObjectis set, so the visibility binding gets the wrong value. I'm sure there's a way to get it to refresh, but I didn't investigate further, since I'm not sure if you even want this feature in the program at all!