diff --git a/examples/r4-tuner/index.html b/examples/r4-tuner/index.html index c14e2ac6..d55f3819 100644 --- a/examples/r4-tuner/index.html +++ b/examples/r4-tuner/index.html @@ -24,7 +24,10 @@ frequencies. It will "snap" to the closest channel.

You can access the selected channel on the property selectedChannel.

- +
+

Default:

+

Set showSource attribute to render the list as well.

+ diff --git a/src/components/r4-tuner.js b/src/components/r4-tuner.js index 71f677a0..4fb73fd1 100644 --- a/src/components/r4-tuner.js +++ b/src/components/r4-tuner.js @@ -1,5 +1,5 @@ import { LitElement, html } from 'lit' -import { sdk } from '@radio4000/sdk' +import { sdk } from '../libs/sdk' export default class R4Tuner extends LitElement { static properties = { @@ -23,8 +23,8 @@ export default class R4Tuner extends LitElement { this.setChannels() } + // Fetches all channels, adds a "frequency" property and sorts by it. async setChannels() { - // Loads channels, sorts by slugs and adds a frequency property. const { data: channels } = await sdk.channels.readChannels() for (const c of channels) { @@ -85,9 +85,9 @@ export default class R4Tuner extends LitElement { } /** - * Generate a unique frequency based on the channel name and slug. + * Generate a unique, deterministic frequency based on the channel name and slug. * All frequency values are rounded to one decimal place. - * Values are deterministic. Values are generated inside a given range. + * Values are generated inside a given range. * @param {string} channelName * @param {string} channelSlug * @param {number} minFreq - the minimum frequency