mirror of
https://github.com/taigrr/wtf
synced 2025-01-18 04:03:14 -08:00
replaced updateInterval with refreshInterval
This commit is contained in:
parent
7cb395f61c
commit
887239b97f
@ -32,7 +32,7 @@ bittrex:
|
||||
left: 2
|
||||
height: 3
|
||||
width: 1
|
||||
updateInterval: 5
|
||||
refreshInterval: 5
|
||||
summary:
|
||||
BTC:
|
||||
displayName: Bitcoin
|
||||
@ -80,6 +80,6 @@ Values: `true`, `false`.
|
||||
`position` <br />
|
||||
Defines where in the grid this module's widget will be displayed. <br />
|
||||
|
||||
`updateInterval` <br />
|
||||
`refreshInterval` <br />
|
||||
How often, in seconds, this module will update its data. <br />
|
||||
Values: A positive integer, `0..n`.
|
||||
|
@ -35,7 +35,6 @@ var baseURL = "https://bittrex.com/api/v1.1/public/getmarketsummary"
|
||||
type Widget struct {
|
||||
wtf.TextWidget
|
||||
summaryList
|
||||
updateInterval int
|
||||
TextColors
|
||||
}
|
||||
|
||||
@ -43,9 +42,8 @@ type Widget struct {
|
||||
func NewWidget() *Widget {
|
||||
|
||||
widget := Widget{
|
||||
TextWidget: wtf.NewTextWidget(" $ Bittrex ", "bittrex", false),
|
||||
summaryList: summaryList{},
|
||||
updateInterval: Config.UInt("wtf.mods.bittrex.updateInterval", 10),
|
||||
TextWidget: wtf.NewTextWidget(" $ Bittrex ", "bittrex", false),
|
||||
summaryList: summaryList{},
|
||||
}
|
||||
|
||||
started = false
|
||||
@ -112,7 +110,7 @@ func (widget *Widget) Refresh() {
|
||||
go func() {
|
||||
for {
|
||||
widget.updateSummary()
|
||||
time.Sleep(time.Second * time.Duration(widget.updateInterval))
|
||||
time.Sleep(time.Second * time.Duration(widget.RefreshInterval()))
|
||||
}
|
||||
}()
|
||||
started = true
|
||||
|
@ -180,7 +180,7 @@
|
||||
</span><span class="w"> </span>left<span class="p">:</span><span class="w"> </span><span class="m">2</span><span class="w">
|
||||
</span><span class="w"> </span>height<span class="p">:</span><span class="w"> </span><span class="m">1</span><span class="w">
|
||||
</span><span class="w"> </span>width<span class="p">:</span><span class="w"> </span><span class="m">1</span><span class="w">
|
||||
</span><span class="w"> </span>updateInterval<span class="p">:</span><span class="w"> </span><span class="m">15</span><span class="w">
|
||||
</span><span class="w"> </span>refreshInterval<span class="p">:</span><span class="w"> </span><span class="m">15</span><span class="w">
|
||||
</span><span class="w"> </span>summary<span class="p">:</span><span class="w"> </span><span class="w">
|
||||
</span><span class="w"> </span>BTC<span class="p">:</span><span class="w">
|
||||
</span><span class="w"> </span>displayName<span class="p">:</span><span class="w"> </span><span class="m">Bitcoin</span><span class="w">
|
||||
|
Loading…
x
Reference in New Issue
Block a user