Add support for detecting ecpNetworkAccessMode#223
Merged
TwitchBronBron merged 9 commits intomasterfrom Dec 5, 2025
Merged
Conversation
…Add a new error when we detect the device ecpSettingMode is set to disabled
TwitchBronBron
requested changes
Nov 26, 2025
Member
TwitchBronBron
left a comment
There was a problem hiding this comment.
Overall this looks good. let's go with ecpNetworkAccessMode for the name of this setting.
src/RokuDeploy.ts
Outdated
| * - 'limited': Restricted functionality, text and movement commands only | ||
| * - 'permissive': Full access for internal networks | ||
| */ | ||
| public async getECPSetting(options: GetDeviceInfoOptions): Promise<'enabled' | 'disabled' | 'limited' | 'permissive'> { |
Member
There was a problem hiding this comment.
Let's name this feature EcpNetworkAccessMode.
Also, let's extract the return value into a named type. Then we can reference that in here. (helps with devs on the outside wanting to reference this type).
export type EcpNetworkAccessMode= 'enabled' | 'disabled' | 'limited' | 'permissive';
src/Errors.ts
Outdated
| } | ||
| } | ||
|
|
||
| export class ECPSettingModeDisabledError extends Error { |
Member
There was a problem hiding this comment.
Align with the new term ecpNetworkAccessMode
src/RokuDeploy.ts
Outdated
| }); | ||
| } catch (e) { | ||
| if ((e as any)?.results?.response?.headers.server?.includes('Roku')) { | ||
| throw new errors.ECPSettingModeDisabledError('ECP Device Info request failed. ECP setting mode is disabled.', response); |
src/Errors.ts
Outdated
| } | ||
| } | ||
|
|
||
| export class EcpNetworkAccessDisabledError extends Error { |
Member
There was a problem hiding this comment.
Should this be EcpNetworkAccessModeDisabledError? because ECP network access mode is currently set to disabled?
TwitchBronBron
approved these changes
Dec 5, 2025
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Add a helper function to get the ecp-setting-mode.
Add error when ecp-setting-mode is disabled.
When requesting device-info and it fails because of the ecp-setting-mode being disabled, then throw the new error.