If an event contained a datetime.datetime object it would cause an
exception in the Splunk component. Most of the media_player
components do this in their `media_position_updated_at` attribute.
Use the JSONEncoder from homeassistant.remote instead of just using the
standard json.dumps encoder.
Fixes#9590
This also fixes issue #1214, and I think another bug. The splunk
code will just take the value of state.state and try to serialize
it to json if it can't make it into a number. It did this before
I generalized that code. Since json.dumps() will fail on most anything
complicated, I think the right thing to do is *not* try to do that.