You could just add a bit of code:
<aura:attribute name="streamingEnabled" type="Boolean" default="false" />
<aura:attribute name="streamingLoaded" type="Boolean" default="false" />
<aura:registerEvent name="onloaded" type="c:streamingEnabled" />
<aura:handler name="change" value="{!v.streamingEnabled}" action="{!c.handleEnable}" />
Note: I'm not including the event here, but you need a new event; we can use this to signal to whatever is using our component that we can use it.
From there, you can change doInit:
doInit: function(component, event, helper) {
component.set("v.streamingLoaded", true);
if(component.get("v.streamingEnabled")) {
helper.startStreaming(component);
}
}
And add your change handler:
handleEnable: function(component, event, helper) {
if(component.get("v.streamingLoaded")) {
if(component.get("v.streamingEnabled")) {
helper.startStreaming(component);
} else {
helper.stopStreaming(component);
}
}
}
You'll need a bit more work than just this, but basically, you just need to attach an extra listener (aura:valueChange), and then toggle the streaming API off/on as you need.