Skip to content

Add support for detecting ecpNetworkAccessMode#223

Merged
TwitchBronBron merged 9 commits intomasterfrom
get-ecb-setting-mode
Dec 5, 2025
Merged

Add support for detecting ecpNetworkAccessMode#223
TwitchBronBron merged 9 commits intomasterfrom
get-ecb-setting-mode

Conversation

@Christian-Holbrook
Copy link
Contributor

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.

…Add a new error when we detect the device ecpSettingMode is set to disabled
Copy link
Member

@TwitchBronBron TwitchBronBron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall this looks good. let's go with ecpNetworkAccessMode for the name of this setting.

* - 'limited': Restricted functionality, text and movement commands only
* - 'permissive': Full access for internal networks
*/
public async getECPSetting(options: GetDeviceInfoOptions): Promise<'enabled' | 'disabled' | 'limited' | 'permissive'> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Align with the new term ecpNetworkAccessMode

});
} 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);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

align with new term

@TwitchBronBron TwitchBronBron changed the title Add more support for detecting the ecp-setting-mode Add more support for detecting ecpNetworkAccessMode Dec 3, 2025
src/Errors.ts Outdated
}
}

export class EcpNetworkAccessDisabledError extends Error {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be EcpNetworkAccessModeDisabledError? because ECP network access mode is currently set to disabled?

@TwitchBronBron TwitchBronBron changed the title Add more support for detecting ecpNetworkAccessMode Add support for detecting ecpNetworkAccessMode Dec 5, 2025
@TwitchBronBron TwitchBronBron merged commit afd389f into master Dec 5, 2025
7 checks passed
@TwitchBronBron TwitchBronBron deleted the get-ecb-setting-mode branch December 5, 2025 18:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants