diff --git a/Configuration/Configuration.cs b/Configuration/Configuration.cs index 5fec588..7325a2b 100644 --- a/Configuration/Configuration.cs +++ b/Configuration/Configuration.cs @@ -1,7 +1,6 @@ using System; using System.IO; using Microsoft.Extensions.Configuration; -using System.Linq; using PushbulletSharp; using PushbulletSharp.Models.Responses; @@ -31,15 +30,14 @@ public PushbulletClient PBClient return _pbClient; } } - - public Subscription PBChannelSubscription { get; private set; } + public string PBTargetDeviceId { get; private set; } private const string ApiEnvironmentKey = EnvironmentConfigPrefix + "PBAPI"; - private const string ChannelEnvironmentKey = EnvironmentConfigPrefix + "CHANNEL"; + private const string DeviceEnvironmentKey = EnvironmentConfigPrefix + "PBDEVICE"; private const string PBSectionKey = "Pushbullet"; private const string ApiKeyConfigKey = "Pushbullet API key"; - private const string ChannelConfigKey = "Channel tag"; + private const string DeviceConfigKey = "Target device"; private IConfigurationSection PushbulletConfigSection { @@ -54,6 +52,7 @@ private IConfigurationSection PushbulletConfigSection return pbConfigSection; } } + #endregion #region Transmission Settings @@ -99,8 +98,7 @@ private void PushbulletSetup() var apiKey = GetPBApiKey(); _pbClient = new PushbulletClient(apiKey, TimeZoneInfo.Local); - - PBChannelSubscription = PBClient.SubscribeToChannel(GetChannelTag()); + PBTargetDeviceId = GetDeviceId(); } @@ -120,21 +118,21 @@ private string GetPBApiKey() return apiKey; } - private string GetChannelTag() + private string GetDeviceId() { - var channelTag = ApplicationConfig[ChannelEnvironmentKey]; + var deviceId = ApplicationConfig[DeviceEnvironmentKey]; - if (string.IsNullOrWhiteSpace(channelTag)) + if (string.IsNullOrWhiteSpace(deviceId)) { - channelTag = PushbulletConfigSection[ChannelConfigKey]; + deviceId = PushbulletConfigSection[DeviceConfigKey]; } - if (string.IsNullOrEmpty(channelTag)) + if (string.IsNullOrEmpty(deviceId)) { - throw new ApplicationException("Please specify a Pushbullet channel tag"); + throw new ApplicationException("Please specify a Pushbullet target device id"); } - return channelTag; + return deviceId; } #endregion diff --git a/configuration.md b/configuration.md index 3691a7d..35b9698 100644 --- a/configuration.md +++ b/configuration.md @@ -5,7 +5,7 @@ This file is to be placed in the applications main directory. ### Section "Pushbullet" * "Pushbullet API key": String containing the Pushbullet API key created for the app. -* "Channel tag": String containing the channel tag where PB should listen +* "Target Device": String containing the device id that PB should target when sending messages ## Section "Transmission" * "Host": String containing the hostname of the transmission server @@ -15,5 +15,5 @@ This file is to be placed in the applications main directory. All Environment Variables pertaining to the importer have to be prefixed with "TPI_". * TPI_PBAPI: Pusbhullet API key -* TPI_CHANNEL: Pushbullet channel tag +* TPI_PBDEVICE: Pushbullet target device * TPI_THOST: Transmission Hostname \ No newline at end of file